Android Beginner: Layout Button and Text

Celina

New Member
I am trying to create an app where there is a row of buttons and then text directly under the center of the buttons. So far, this is what I have:\[code\]<FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" > <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/blue"/> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/red" android:layout_gravity="center"/> <Button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/green" android:layout_gravity="right"/></FrameLayout><RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginTop="2.5dip" android:layout_marginLeft="7.5dip" android:text="@string/button1" android:gravity="center" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginTop="2.5dip" android:text="@string/button2" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:layout_marginTop="2.5dip" android:layout_marginRight="5dip" android:text="@string/button3" /></RelativeLayout>\[/code\]but the text does not line up under the center of the buttons. Can someone please help?
 
Back
Top