2012-11-01 54 views
0

同事,你能告訴我設置成ImageView的屬性來獲得這樣的畫面?對於我的巨大的Android應用程序本次活動的Android TableLayout 2 imageview的每個tablerow的

enter image description here

XML代碼, 1日後在這裏避免 您的文章沒有什麼太大的上下文解釋代碼段;請更清楚地解釋您的方案。 ..... Lorem存有胡蘿蔔,增強回扣,但他們occaecat時間和活力,如勞動力和肥胖。多年來,我會來的,誰將會nostrud aliquip了她鍛鍊的優勢,使刺激措施,如果學區和長壽。想成爲在cupidatat cillum疼痛已經在DUIS等dolore麥格納被批評逃離產生任何結果的樂趣。 Excepteur cupidatat黑人就不是excepteur,舒緩心靈,那就是,他們拋棄了那些誰是責怪你的煩惱的一般責任。

  <TableRow 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:background="#D63B40" 
       android:layout_weight="0.15" 
       > 

       <ImageView 
       android:id="@+id/img1" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:src="@drawable/n" 
       android:background="@null" 
       /> 


       <ImageView 
       android:id="@+id/r1" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:src="@drawable/n" 
       android:background="@null" 
       /> 



      </TableRow> 

      <TableRow 
       android:id="@+id/tableRow2" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:background="#88CB5B" 
       android:layout_weight="0.14" > 

       <ImageView 
       android:id="@+id/img2" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:src="@drawable/n" 
       android:background="@null" 
       /> 


       <ImageView 
       android:id="@+id/r2" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:src="@drawable/n" 
       android:background="@null" 
       /> 

      </TableRow> 

      <TableRow 
       android:id="@+id/tableRow3" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:background="#E8D751" 
       android:layout_weight="0.14" > 

       <ImageView 
       android:id="@+id/3" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:src="@drawable/n" 
       android:background="@null" 
       /> 


       <ImageView 
       android:id="@+id/r3" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:src="@drawable/n" 
       android:background="@null" 
       /> 
      </TableRow> 

      <TableRow 
       android:id="@+id/tableRow4" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:background="#9554B6" 
       android:layout_weight="0.14" > 

      <ImageView 
       android:id="@+id/4" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:src="@drawable/n" 
       android:background="@null" 
       /> 


       <ImageView 
       android:id="@+id/r4" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:src="@drawable/n" 
       android:background="@null" 
       /> 

      </TableRow> 

    </TableLayout> 

圖像1,2,3和4以及a,b,C,d爲ImageView的。

+0

爲什麼不直接使用自定義的ListView工作? 1'm只是好奇 –

+0

我猜üSHLD使用列表視圖。 –

+0

@ErrorHandler OK那麼如何讓每個項目的高度相等,他們都在一起,以適應1個屏幕? –

回答

0

使用列表視圖然後使用自定義適配器 u能兩個圖像(在烏拉圭回合條件)添加到列表中。此鏈接將有助於U與適配器

+0

@Ivan Fazaniuk:這是工作的罰款 –

相關問題