アンドロイドでは、私はコードのブロックを持っています:
// RelativeLayout with id is "root": main.xml
<EditText
android:id="@+id/pref_edit_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:hint="Text to share in preference"
/>
// This is the button I want to add to main.xml
<Button
android:id="@+id/save_button"
android:layout_below="@id/pref_edit_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Save"
/>
私の活動では、ビューの位置にをRelativeLayout.LayoutParam
追加することはできますが、別のビューの追加などはできません!! だから、誰もが動的に別のものに関連するを追加するための提案を与えることができますか?button
left, right, top, bottom
root
below
view
view
RelativeLayout