android - Wrap buttons ontop and in middle using Relative Layout -
i have layout similar
kinda feel guilty because asked question layouts had no idea needed this(nor did know hard), have researched view layouts , i've tried use layout.torightof
etc etc. have left/right arrows, need add , down buttons
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:game_view="http://schemas.android.com/apk/res/pap.crowslanding" android:layout_width="fill_parent" android:layout_height="wrap_content" > <framelayout android:id="@+id/flayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_above="@+id/button1" android:orientation="vertical" > <pap.crowslanding.gameview android:id="@+id/game_view" android:layout_width="fill_parent" android:layout_height="fill_parent" game_view:balldiam="@dimen/balldiam" game_view:cellwidth="@dimen/cellwidth" game_view:pixelheight="@dimen/pixelheight" game_view:pixelwidth="@dimen/pixelwidth" /> <pap.crowslanding.mazeball android:id="@+id/mazeball" android:layout_width="fill_parent" android:layout_height="fill_parent" android:visibility="invisible" game_view:balldiam="@dimen/balldiam" game_view:cellwidth="@dimen/cellwidth" /> </framelayout> <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:orientation="horizontal" > <button android:id="@+id/button1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/right" > </button> <button android:id="@+id/button2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/down" /> </linearlayout> </relativelayout>
so essentially, insight on how add , down buttons within same layout avoid layouts drawn onto activity , overlapping
it seems button images have same height, why not use tablelayout
? keep top-left , top-right cells empty, , in other cells put buttons.
code (ommitting variables):
<tablelayout> <tablerow> <view /> <button>...</button> <view /> </tablerow> <tablerow> <button>...</button> <button>...</button> <button>...</button> </tablerow> </tablelayout>
Comments
Post a Comment