2016-04-26 3 views
-2

Я новичок в Android, и я работаю над приложением, которое должно показывать кнопки таким образом.Прозрачность кнопки в горизонтальном прокрутке

buttons_img

Я использовал HorizontalScrollView, чтобы продемонстрировать это действие, но я не знаю, как сделать прозрачные кнопки шаг за шагом, как на картинке.

Справка будет принята с благодарностью.

+1

что вы пробовали? –

+0

Я просто работаю над HorizontalScrollView, но мне нужно быть прозрачным. – Alek

+0

вы можете изменить текущий вид, а не другой вид, поэтому вам нужно работать в центре. –

ответ

0
<HorizontalScrollView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:scrollbarSize="0dp" 
    > 

    <LinearLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" > 

     <LinearLayout 
      android:padding="16dp" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:gravity="center" 
      android:orientation="vertical"> 
      <ImageView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:src="@mipmap/ic_launcher" /> 
      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Learn" /> 
     </LinearLayout> 

     <LinearLayout 
      android:padding="16dp" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:gravity="center" 
      android:orientation="vertical"> 
      <ImageView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:src="@mipmap/ic_launcher" /> 
      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Android" /> 
     </LinearLayout> 

     <LinearLayout 
      android:padding="16dp" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:gravity="center" 
      android:orientation="vertical"> 
      <ImageView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:src="@mipmap/ic_launcher" /> 
      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Step" /> 
     </LinearLayout> 

Смежные вопросы