android - How to align check boxes in frame Layout -
<framelayout android:layout_width="wrap_content" android:layout_height="wrap_content" > <checkbox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="click" /> <checkbox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="click" /> <checkbox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="click" /> <checkbox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="click" /> </framelayout>
this main xml file check boxes collapsing. want vertically. please suggest me.
you should replace framelayout
linearlayout
. docs:
framelayout
designed block out area on screen display single item. generally, framelayout
should used hold single child view, because can difficult organize child views in way that's scalable different screen sizes without children overlapping each other. can, however, add multiple children framelayout
, control position within framelayout
assigning gravity each child, using android:layout_gravity
attribute.
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <checkbox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="click" /> <checkbox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="click" /> <checkbox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="click" /> <checkbox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="click" /> </linearlayout>
Comments
Post a Comment