In android, I have a code block:
// 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"
/>
In my activity, with RelativeLayout.LayoutParam, I can add buttonto a position left, right, top, bottomin a view root, but I cannot add belowor etc ... another view !! So, anyone can give a suggestion to add view, which is dynamically linked to another viewin RelativeLayout?
source
share