請幫我在RadioButton
下動態添加RelativeLayout
(我必須在課程中創建RelativeLayout
和RadioButton
)。如何在某些元素下動態添加相對佈局
事情是這樣的:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<RadioButton
android:id="@+id/radioButton3"
android:text="RadioButton" />
<RelativeLayout
android:id="@+id/relativeLayout2"
android:layout_below="@+id/radioButton3"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</RelativeLayout>
</LinearLayout>
要查看我可以這樣寫:
myLayout.addView(myView, layoutParams);
但是怎麼樣的ViewGroup?
格式代碼,並添加缺少的支架的RelativeLayout所以XML是有效的 – 2015-03-06 17:04:13