0
我尝试将按钮动态添加到TableRow,但遇到错误。可以在android中动态地将控件添加到TableRow中吗?
布局XML
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:id="@+id/layout" >
<TableRow android:id="@+id/jumble">
</TableRow>
</TableLayout>
错误线
TableRow tr = (TableRow) findViewById(R.id.jumble);
有一个空的异常。
它甚至可以做到这一点?或者我将不得不动态添加TableRow到TableLayout?