2015-07-22 64 views

回答

1

由於Karakuri在評論中說,嵌套LinearLayouts會的最佳途徑使您的這樣

enter image description here

這裏所需要的視圖是佈局的代碼

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:weightSum="3" 
    android:padding="16dp" 
    android:orientation="horizontal"> 


    <LinearLayout 
     android:orientation="vertical" 
     android:layout_weight="1" 
     android:gravity="center" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/ic_action_repeat_48d"/> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Repeat"/> 

    </LinearLayout> 

    <LinearLayout 
     android:orientation="vertical" 
     android:layout_weight="1" 
     android:gravity="center" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/ic_action_heart_48d"/> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Favourite"/> 

    </LinearLayout> 

    <LinearLayout 
     android:orientation="vertical" 
     android:layout_weight="1" 
     android:gravity="center" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/ic_action_shuffle_48dp"/> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Shuffle"/> 

    </LinearLayout> 

</LinearLayout> 

該代碼只是一個佈局結構,您必須根據需要添加填充和寬度高度ImageView。你必須爲你想要的佈局做一些工作。如果你想要兩行同樣你的上傳圖片,只需複製佈局兩次。

希望它幫助或刪除評論,如果有任何麻煩實施。

乾杯!