How to show three buttons at the bottom of the screen like facebook in android?



I am working with android and I need to make an XML design in which I need to have three buttons at the bottom of my screen horizontally always. Just like facebook application in android, they have three buttons at the bottom of the screen (Status, Photo, Check In) - similarly I need to have three buttons as well always in my application.


What will be the design for this kind of layout?


I tried with the below XML design but it doesn't work somehow and they all are coming vertical -



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
android:id="@+id/db1_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/cow"
android:layout_weight="0"
android:textAppearance="?android:attr/textAppearanceLarge" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:gravity="center|bottom"
android:orientation="vertical" >

<Button
android:id="@+id/button1"
style="?android:attr/buttonStyleSmall"
android:layout_width="145dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center"
android:text="ButtonA" />

<Button
android:id="@+id/button2"
style="?android:attr/buttonStyleSmall"
android:layout_width="145dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center"
android:text="ButtonB" />

<Button
android:id="@+id/button3"
style="?android:attr/buttonStyleSmall"
android:layout_width="145dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center"
android:text="ButtonC" />
</LinearLayout>

</LinearLayout>


I just need to show three buttons at the bottom of the screen horizontally just like facebook shows always side by side (touching each other). Is this possible to do?


Button names can be - ButtonA, ButtonB and ButtonC


No comments:

Post a Comment