Skip to content

Instantly share code, notes, and snippets.

@hashbrown
Forked from romannurik/button_bar_layout.xml
Created April 10, 2012 13:40
Show Gist options
  • Save hashbrown/2351452 to your computer and use it in GitHub Desktop.
Save hashbrown/2351452 to your computer and use it in GitHub Desktop.
How to make a proper button bar on ICS
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="?android:attr/dividerHorizontal"
android:showDividers="middle">
<TextView android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:text="Hello World" />
<LinearLayout style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="One" />
<Button style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Two" />
</LinearLayout>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment