2016-07-14 40 views

回答

0

你可以试试这个。

<LinearLayout 
     android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <ScrollView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:id="@+id/scrollView2" > 

      <LinearLayout 
       android:orientation="vertical" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent"> 

       <LinearLayout 
        android:orientation="vertical" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent"> 

        <ImageView 
         android:layout_width="match_parent" 
         android:layout_height="150dp" 
         android:id="@+id/imageView3" 
         android:background="@drawable/pd5"/> 
       </LinearLayout> 

       <LinearLayout 
        android:orientation="vertical" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent"> 

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

         <ImageView 
          android:layout_width="0dp" 
          android:layout_height="120dp" 
          android:id="@+id/imageView4" 
          android:layout_weight="1" 
          android:background="@drawable/pd2" 
          android:layout_margin="5dp" /> 

         <ImageView 
          android:layout_width="0dp" 
          android:layout_height="120dp" 
          android:id="@+id/imageView5" 
          android:layout_weight="1" 
          android:background="@drawable/pd3" 
          android:layout_margin="5dp" /> 
        </LinearLayout> 
        <LinearLayout 
         android:orientation="horizontal" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content"> 

         <ImageView 
          android:layout_width="0dp" 
          android:layout_height="120dp" 
          android:id="@+id/imageView6" 
          android:layout_weight="1" 
          android:background="@drawable/pd2" 
          android:layout_margin="5dp" /> 

         <ImageView 
          android:layout_width="0dp" 
          android:layout_height="120dp" 
          android:id="@+id/imageView7" 
          android:layout_weight="1" 
          android:background="@drawable/pd3" 
          android:layout_margin="5dp" /> 
        </LinearLayout> 
        <LinearLayout 
         android:orientation="horizontal" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content"> 

         <ImageView 
          android:layout_width="0dp" 
          android:layout_height="120dp" 
          android:id="@+id/imageView8" 
          android:layout_weight="1" 
          android:background="@drawable/pd2" 
          android:layout_margin="5dp" /> 

         <ImageView 
          android:layout_width="0dp" 
          android:layout_height="120dp" 
          android:id="@+id/imageView9" 
          android:layout_weight="1" 
          android:background="@drawable/pd3" 
          android:layout_margin="5dp" /> 
        </LinearLayout> 
       </LinearLayout> 
      </LinearLayout> 
     </ScrollView> 
    </LinearLayout> 

它对你有帮助。

+0

非常感谢............ – Ashwin

+0

你能告诉我main_activity .class编码上面的xml代码。 – Ashwin

1

使用这个概念

Linear Layoutorientation="vertical"父布局......

Linear布局ImageViewGridView .......

,并使用custom adapterGridView .....

看起来这个和你的问题一样Image and Text GridView

这是所有........

享受编码........

+0

谢谢你的家伙.... – Ashwin