1
我有一個TableLayout
元素在我的main.xml
:如何在android jdk中動態地用ImageView填充TableLayout?
<TableLayout android:id="@+id/TableLayout01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TableLayout>
我不想硬編碼ImageView
在main.xml
。
如何嵌入ImageView
在.java
?
你可以看看Android開發者官方網站的教程之一,特別是這一個:http://developer.android.com/resources/tutorials/views/hello-gridview.html。它使用`GridView`而不是`TableLayout`,但是展示瞭如何在Java代碼中挑選圖像和填充`ImageView`實例。 – 2011-01-12 07:04:05