android - How to move to the left ToggleButton in vertical LinearLayout -
my activity screen created vertical linearlayout. want add togglebutton left side of screen. tried make gravity parameter here:
<togglebutton android:id="@+id/togglebutton1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="20sp" android:gravity="left"/>
however put text on button left , not button itself. how can move button left in vertical linearlayout?
considering linearlayout defines android:layout_width="match_parent"...use this:
<togglebutton android:id="@+id/togglebutton1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="20sp" android:layout_gravity="left"/>
android:layout_gravity == alignment on layout element included (i.e. linearlayout)
android:gravity == alignment of internal elements (i.e. text inside button).
Comments
Post a Comment