I recommend using RelativeLayout. You can put your flag in relation to other views or the parent view, for example, if you want to put it on the right side and under the TextView, you can use something like
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:id="@+id/textview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Text" /> <CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_below="@+id/textview" /> </RelativeLayout>
Also look at droiddraw.org, but I recommend writing the code yourself, as it speeds up the process if you ever need to edit / reuse.
For more information about RelativeLayout, see http://d.android.com/reference/android/widget/RelativeLayout.html
m6tt
source share