Three Button RelativeLayout with View Dividers

Alvedrale

New Member
I'm trying to create a better looking button bar for my app to match the theme.So far, I'm using the following code: \[code\]<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/footer" style="@android:style/ButtonBar" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="bottom" android:orientation="horizontal" > <Button android:id="@+id/Formula" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="Formula" /> <Button android:id="@+id/Solve" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="Solve" /> <Button android:id="@+id/Clear" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="Clear" /></LinearLayout>\[/code\]And it gives me a result like this:
uxvaW.png
I'm also working on some code to replace that bar with a better looking one. It is as follows:\[code\]<RelativeLayout android:layout_width="match_parent" android:layout_height="48dp" android:layout_alignParentBottom="true" > <View android:layout_width="match_parent" android:layout_height="1dip" android:layout_alignParentTop="true" android:layout_marginLeft="4dip" android:layout_marginRight="4dip" android:background="@drawable/black_white_gradient" /> <View android:id="@+id/ViewOne" android:layout_width="1dip" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginBottom="4dip" android:layout_marginTop="4dip" android:background="@drawable/black_white_gradient" /> <Button android:id="@+id/ButtonOne" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_toLeftOf="@id/ViewOne" android:background="@color/button_blue_background" android:paddingTop="5dp" android:text="Cancel" android:textColor="@color/button_dark_text" /> <Button android:id="@+id/ButtonTwo" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:layout_toRightOf="@id/ViewOne" android:background="@color/button_blue_background" android:text="OK" android:textColor="@color/button_dark_text" /></RelativeLayout>\[/code\]Which results in:
oKLwf.png
So my issue is that I'm unable to get three buttons on the new black bar. I've tried adding more views and buttons with the android:layout_toRightOf attributes but it still won't work.Are there any ideas on what I could possibly do to achieve this?
 
Back
Top