android studio LinearLayout image starting point -
i new android programming , trying position "circle ball" image file linearlayout in middle. so, have tried making 7 linearlayouts equally divided , trying put image @ bottom of 4th linearlayout. code below shows have 7 linearlayouts. how can put "circle ball" image @ bottom of 4th linearlayout? also, creating 7 linearlayouts idea? purpose of ball move ball next linearlayout when click "next" button.
<linearlayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" android:layout_above="@+id/view"> <linearlayout android:id="@+id/layout1" android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="fill_parent"/> <linearlayout android:id="@+id/layout2" android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="fill_parent"/> <linearlayout android:id="@+id/layout3" android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="fill_parent"/> <linearlayout android:id="@+id/layout4" android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="fill_parent"/> <linearlayout android:id="@+id/layout5" android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="fill_parent"/> <linearlayout android:id="@+id/layout6" android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="fill_parent"/> <linearlayout android:id="@+id/layout7" android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="fill_parent"/> </linearlayout>
layout have posted badly designed layout. if image want show on screen directly put image in linearlayout , set layout's gravity center.
<linearlayout android:layout_width="match_parent" android:layout_height="match+parent" android:gravity="center"> <imageview ... /> </linearlayout> or, if there other views in layout , want image placed in center use relativelayout
<relativelayout android:layout_width="match_parent" android:layout_height="match_parent"> <imageview android:layout_centerinparent="true" ... /> </relativelayout>
Comments
Post a Comment