How to fill the background efficiently with white text and black background.when i fill the backgound using this code in xml in Button filed
android:background="#c6010101"
Button code is here
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/OpenBraces"
android:id="#+id/buttonOB"
android:layout_above="#+id/button1"
android:layout_toRightOf="#+id/button1"
android:layout_toEndOf="#+id/button1"
android:background="#c6010101"
android:textColor="#FFFFFCFC" />
Full code is here.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:paddingBottom="#dimen/activity_vertical_margin" tools:context=".MainActivity">
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/editText"
android:inputType="textCapCharacters"
android:digits="0123456789=+-*^/{}.xX"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<!-- Footer Ends -->
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="4"
android:layout_above="#+id/linearLayout2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:orientation="horizontal" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/One"
android:id="#+id/button1"
android:layout_above="#+id/button4"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="#64010001"
android:textColor="#FFFFFCFC" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Two"
android:id="#+id/button2"
android:layout_alignTop="#+id/button1"
android:layout_toRightOf="#+id/button1"
android:layout_toEndOf="#+id/button1"
android:background="#64010001"
android:textColor="#FFFFFCFC" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Three"
android:id="#+id/button3"
android:layout_alignBottom="#+id/button2"
android:layout_toRightOf="#+id/button2"
android:layout_toEndOf="#+id/button2"
android:background="#64010001"
android:textColor="#FFFFFCFC" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Plus"
android:id="#+id/buttonPlus"
android:layout_above="#+id/button6"
android:layout_toRightOf="#+id/button3"
android:layout_toEndOf="#+id/button3"
android:backgroundTint="#c6010101"
android:textColor="#FFFFFCFC" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="4"
android:layout_above="#+id/linearLayout3"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Four"
android:id="#+id/button4"
android:layout_above="#+id/button7"
android:layout_toLeftOf="#+id/button8"
android:layout_toStartOf="#+id/button8"
android:background="#64010001"
android:textColor="#FFFFFCFC" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Five"
android:id="#+id/button5"
android:layout_above="#+id/button8"
android:layout_alignLeft="#+id/button2"
android:layout_alignStart="#+id/button2"
android:background="#64010001"
android:textColor="#FFFFFCFC" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Six"
android:id="#+id/button6"
android:layout_alignTop="#+id/button5"
android:layout_toRightOf="#+id/button5"
android:layout_toEndOf="#+id/button5"
android:background="#64010001"
android:textColor="#FFFFFCFC"
android:singleLine="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Minus"
android:id="#+id/buttonMinus"
android:layout_above="#+id/button9"
android:layout_toRightOf="#+id/button6"
android:layout_toEndOf="#+id/button6"
android:backgroundTint="#c6010101"
android:textColor="#FFFFFCFC" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/linearLayout4"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Seven"
android:id="#+id/button7"
android:layout_above="#+id/button0"
android:layout_toLeftOf="#+id/button8"
android:layout_toStartOf="#+id/button8"
android:background="#64010001"
android:textColor="#FFFFFCFC" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Eight"
android:id="#+id/button8"
android:layout_alignBottom="#+id/button7"
android:layout_alignLeft="#+id/button5"
android:layout_alignStart="#+id/button5"
android:background="#64010001"
android:textColor="#FFFFFCFC" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Nine"
android:id="#+id/button9"
android:layout_alignTop="#+id/button8"
android:layout_toRightOf="#+id/button8"
android:layout_toEndOf="#+id/button8"
android:background="#64010001"
android:textColor="#FFFFFCFC" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Multiply"
android:id="#+id/buttonMul"
android:layout_alignBottom="#+id/button9"
android:layout_toRightOf="#+id/button9"
android:layout_toEndOf="#+id/button9"
android:backgroundTint="#c6010101"
android:textColor="#FFFFFCFC" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:weightSum="4"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Dot"
android:id="#+id/buttonDot"
android:background="#64010001"
android:textColor="#FFFFFCFC"
android:layout_below="#+id/button7"
android:layout_toLeftOf="#+id/button8"
android:layout_toStartOf="#+id/button8" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Zero"
android:id="#+id/button0"
android:layout_alignParentBottom="true"
android:layout_toRightOf="#+id/button7"
android:layout_alignRight="#+id/button8"
android:layout_alignEnd="#+id/button8"
android:background="#64010001"
android:textColor="#FFFFFCFC" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Equal"
android:id="#+id/buttonEqual"
android:backgroundTint="#c6010101"
android:textColor="#FFFFFCFC"
android:layout_alignParentBottom="true"
android:layout_toRightOf="#+id/button0"
android:layout_toEndOf="#+id/button0" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Divide"
android:id="#+id/buttonDiv"
android:layout_alignParentBottom="true"
android:layout_toRightOf="#+id/button9"
android:layout_toEndOf="#+id/button9"
android:backgroundTint="#c6010101"
android:textColor="#FFFFFCFC" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/linearLayout1"
android:orientation="horizontal"
android:weightSum="4">
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/VariableX"
android:layout_weight="1"
android:id="#+id/buttonVarX"
android:layout_above="#+id/button1"
android:layout_toLeftOf="#+id/button2"
android:layout_toStartOf="#+id/button2"
android:backgroundTint="#c6010101"
android:textColor="#FFFFFCFC" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/OpenBraces"
android:id="#+id/buttonOB"
android:layout_above="#+id/button1"
android:layout_toRightOf="#+id/button1"
android:layout_toEndOf="#+id/button1"
android:background="#c6010101"
android:textColor="#FFFFFCFC" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/CloseBraces"
android:id="#+id/buttonCB"
android:layout_above="#+id/button2"
android:layout_toRightOf="#+id/button2"
android:layout_alignRight="#+id/button3"
android:layout_alignEnd="#+id/button3"
android:backgroundTint="#c6010101"
android:textColor="#FFFFFCFC" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/Power"
android:id="#+id/buttonPow"
android:backgroundTint="#c6010101"
android:textColor="#FFFFFCFC"
android:layout_above="#+id/buttonPlus"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</LinearLayout>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="40dp"
android:id="#+id/buttonBS"
android:src="#android:drawable/ic_media_rew"
android:background="#c6010101"
android:contentDescription="#string/Back"
android:layout_above="#+id/linearLayout0"
android:layout_alignRight="#+id/webView"
android:layout_alignEnd="#+id/webView" />
<WebView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/webView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/editText"
android:layout_alignRight="#+id/linearLayout1"
android:layout_alignEnd="#+id/linearLayout1"
android:layout_above="#+id/buttonBS" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/buttonSolution"
android:id="#+id/buttonSol"
android:layout_above="#+id/linearLayout0"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
then it android:background not only fill the button area but also fills the outer area of the button. At this area the button click is not working because it is not part of the Button but it looks like as it is part of the button as you can see in this pic
The empty space out side of the button is shown in this picture. i want to show it with this shape with white text and black button color.
i have also try to use android:backgroundTint="#c6010101" it shows in android as i want but it does not work on mobile.
it can be resolved by giving the shape. we can do it by using the select
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#drawable/button_1_selected"
android:state_pressed="true"/>
<!-- focused state -->
<item android:drawable="#drawable/button_1_focused"
android:state_focused="true"/>
<!-- default state -->
<item android:drawable="#drawable/button_1_normal"/>
</selector>
write this code and save with extension .xml (btn_black.xml) in drawable folder of E:\My-Application\app\src\main\res\drawable
and in your button xml code add this code
also write the code of focused, normal and selected in xml and save in the same folder(drawable) with the the name as you have given in the selector code. in this code file name will be
button_1_focused.xml
button_1_normal.xml
button_1_selected.xml
button_1_normal.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#color/button_1_normal_background"/>
<corners android:radius="10dip"/>
</shape>
similer for other .
Also see this side http://www.codeproject.com/Articles/1006843/An-Efficient-Way-to-Make-Button-Color-Change-on-An
Related
This is Nexus 6 virtual device with which I have rendered my activity_.xml
This is the device when I change it automatically edits the components(for example the CLEAR button in the app)
Following is my activity_main.xml file which I have used in the project:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:weightSum="1"
tools:context=".MainActivity">
<TextView
android:id="#+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="arial"
android:text="Enter Numbers"
android:textSize="20sp"
android:layout_marginLeft="15dp"/>
<EditText
android:id="#+id/et1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toEndOf="#+id/text1"
android:layout_toRightOf="#id/text1"
android:layout_marginRight="15dp"/>
<Button
android:id="#+id/b1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/text1"
android:layout_marginTop="40dp"
android:layout_marginLeft="15dp"
android:text="1" />
<Button
android:id="#+id/b2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/b1"
android:layout_toEndOf="#+id/b1"
android:layout_toRightOf="#+id/b1"
android:clickable="true"
android:text="2" />
<Button
android:id="#+id/b3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/b2"
android:layout_toEndOf="#+id/b2"
android:layout_toRightOf="#+id/b2"
android:clickable="true"
android:text="3" />
<Button
android:id="#+id/b4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#id/b3"
android:layout_toEndOf="#id/b3"
android:layout_toRightOf="#id/b3"
android:clickable="true"
android:text="4" />
<Button
android:id="#+id/b5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/b1"
android:layout_marginLeft="15dp"
android:clickable="true"
android:text="5" />
<Button
android:id="#+id/b6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#id/b5"
android:layout_toEndOf="#+id/b5"
android:layout_toRightOf="#id/b5"
android:clickable="true"
android:text="6" />
<Button
android:id="#+id/b7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#id/b6"
android:layout_toEndOf="#id/b6"
android:layout_toRightOf="#+id/b6"
android:clickable="true"
android:text="7" />
<Button
android:id="#+id/b8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#id/b7"
android:layout_toEndOf="#id/b7"
android:layout_toRightOf="#+id/b7"
android:clickable="true"
android:text="8" />
<Button
android:id="#+id/b9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/b5"
android:layout_marginLeft="15dp"
android:clickable="true"
android:text="9" />
<Button
android:id="#+id/b0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/b9"
android:layout_toEndOf="#+id/b9"
android:layout_toRightOf="#+id/b9"
android:clickable="true"
android:text="0" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/b10"
android:text="."
android:layout_toRightOf="#+id/b0"
android:layout_toEndOf="#id/b0"
android:layout_alignTop="#id/b0"
android:clickable="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/b11"
android:text="Clear"
android:layout_alignTop="#id/b10"
android:layout_toRightOf="#+id/b10"
android:layout_toEndOf="#id/b10"
android:clickable="true"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/b12"
android:text="+"
android:layout_below="#+id/b9"
android:layout_marginLeft="15dp"
android:layout_marginTop="40dp"
android:clickable="true"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/b13"
android:text="-"
android:layout_alignTop="#id/b12"
android:layout_toRightOf="#+id/b12"
android:layout_toEndOf="#id/b12"
android:clickable="true"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/b14"
android:text="*"
android:layout_alignTop="#id/b13"
android:layout_toRightOf="#+id/b13"
android:layout_toEndOf="#id/b13"
android:clickable="true"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/b15"
android:text="/"
android:layout_alignTop="#id/b14"
android:layout_toRightOf="#+id/b14"
android:layout_toEndOf="#id/b14"
android:clickable="true"
/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/b16"
android:text="="
android:layout_marginLeft="15dp"
android:layout_below="#+id/b13"
android:clickable="true"
android:layout_alignRight="#+id/b15"
android:layout_alignEnd="#+id/b15" />
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:id="#+id/text2"
android:hint="Result"
android:layout_below="#+id/b16"
android:layout_alignLeft="#+id/b16"
android:layout_alignStart="#+id/b16"
android:layout_alignRight="#+id/et1"
android:layout_alignEnd="#+id/et1" />
</RelativeLayout>
When I switch between devices I want my design to be displayed the same way as it is displayed in Nexus 6.
Please help me out with the above issues. I have surfed the net but I'm not finding any appropriate answer to resolve my query.
After looking in google and in the from for set boundaries to fit text in RelativeLayout to the button size.
Android Button layout with big text size didn't help
How to fit text on Button? didn't help
How does setting baselineAligned to false improve performance in LinearLayout? I am on Relative
example from my app:
http://tinypic.com/view.php?pic=2wec9d5&s=8#.VUZns_lVhBc
My xml button:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/bg_game"
tools:context=".ClassicMode" >
<Gallery
android:id="#+id/gallery1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="10dp"
android:scaleType="fitXY"
android:scaleX="2"
android:scaleY="2" />
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:orientation="horizontal" >
</LinearLayout>
<TextView
android:id="#+id/numOfGuesses"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="23dp"
android:layout_toLeftOf="#+id/linearLayout1"
android:layout_toRightOf="#+id/gallery1"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/guesses"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/guesses"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="60px" />
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="23dp"
android:layout_marginTop="18dp"
android:orientation="horizontal" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="226dp"
android:layout_height="152dp"
android:scaleX="1"
android:scaleY="1"
android:src="#drawable/argentina" />
</LinearLayout>
<Button
android:id="#+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/linearLayout1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:background="#android:color/transparent"
android:onClick="check"
android:scaleX="1.5"
android:scaleY="1.5"
android:text="Button"
android:textStyle="bold" />
<Button
android:id="#+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button1"
android:layout_below="#+id/button1"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:background="#android:color/transparent"
android:onClick="check"
android:scaleX="1.5"
android:scaleY="1.5"
android:text="Button"
android:textStyle="bold" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button3"
android:layout_below="#+id/button3"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:background="#android:color/transparent"
android:onClick="check"
android:scaleX="1.5"
android:scaleY="1.5"
android:text="Button"
android:textStyle="bold" />
<Button
android:id="#+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button2"
android:layout_below="#+id/button2"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:background="#android:color/transparent"
android:onClick="check"
android:scaleX="1.5"
android:scaleY="1.5"
android:text="Button"
android:textStyle="bold" />
<TextView
android:id="#+id/scorenum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/linearLayout1"
android:layout_alignParentLeft="true"
android:textSize="60px" />
<TextView
android:id="#+id/score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/scorenum"
android:layout_alignParentLeft="true"
android:text="#string/score"
android:textSize="60px" />
<Button
android:id="#+id/hint"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="#drawable/circle"
android:gravity="center_vertical|center_horizontal"
android:text="hint"
android:textColor="#fff" />
</RelativeLayout>
Try setting following properties on your buttons:
android:layout_marginRight="0dp"
android:layout_marginLeft="0dp"
android:singleLine="false" // set this to true if you want your text to be single line
// or to false otherwise
And I suggest removing this line from your buttons:
android:layout_alignLeft="some_button_id"
I have RelativeLayout which has other elements such as imageview, textview inside it. When i run the app with small screen size (Galaxy S2) it is displayed as image 1. But when it runs on a larger screen (Nexus 7) it is displayed as in image 2. I do not want to enlarge the image for larger screens and i want it to keep certain sizes i set (see .xml). But how i can make it appears at the center on large screens (as in image 3).
Thank you for suggestions.
.xml file:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/ll1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/stainbck"
android:orientation="vertical"
android:padding="25dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Customized Templates"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#eaeaea" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="#+id/btn1"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_weight="1"
android:text="1" />
<Button
android:id="#+id/btn2"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/btn1"
android:layout_weight="1"
android:text="2" />
<Button
android:id="#+id/btn3"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/btn2"
android:layout_weight="1"
android:text="3" />
<Button
android:id="#+id/btn4"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="4" />
</LinearLayout>
<LinearLayout
android:id="#+id/relative2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="#+id/btn5"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_weight="1"
android:text="5" />
<Button
android:id="#+id/btn6"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_weight="1"
android:text="6" />
<Button
android:id="#+id/btn7"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toLeftOf="#+id/btn6"
android:layout_weight="1"
android:text="7" />
<Button
android:id="#+id/btn8"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toLeftOf="#+id/btn7"
android:layout_weight="1"
android:text="8" />
</LinearLayout>
<RelativeLayout
android:id="#+id/relative"
android:layout_width="265dp"
android:layout_height="200dp"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:gravity="center"
android:longClickable="true" >
<ImageView
android:id="#+id/blankcard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:adjustViewBounds="true" />
<TextView
android:id="#+id/crdCompany"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Company"
android:textColor="#20526d"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="#+id/crdWebsite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="16dp"
android:text="website"
android:textColor="#20526d"
android:textSize="9sp"
android:textStyle="bold" />
<TextView
android:id="#+id/crdAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/crdPhone"
android:layout_alignParentLeft="true"
android:text="address"
android:textColor="#20526d"
android:textSize="13sp"
android:textStyle="bold" />
<TextView
android:id="#+id/crdEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/crdWebsite"
android:layout_alignBottom="#+id/crdWebsite"
android:layout_alignParentRight="true"
android:text="email"
android:textColor="#20526d"
android:textSize="9sp"
android:textStyle="bold" />
<TextView
android:id="#+id/crdPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/crdWebsite"
android:layout_alignParentLeft="true"
android:layout_marginBottom="17dp"
android:text="phone"
android:textColor="#20526d"
android:textSize="13sp"
android:textStyle="bold" />
<TextView
android:id="#+id/crdName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/crdCompany"
android:text="name"
android:textColor="#20526d"
android:textSize="13sp"
android:textStyle="bold" />
<TextView
android:id="#+id/crdTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/crdName"
android:layout_marginTop="12dp"
android:text="title"
android:textColor="#20526d"
android:textSize="13sp"
android:textStyle="bold" />
<TextView
android:id="#+id/crdMobile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/crdTitle"
android:layout_marginTop="5dp"
android:text="mobile"
android:textColor="#20526d"
android:textSize="13sp"
android:textStyle="bold" />
<FrameLayout
android:id="#+id/frameLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="25dp" >
<ImageView
android:id="#+id/crdlogoframe"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_alignParentLeft="true"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="#drawable/border"
android:visibility="visible" />
</FrameLayout>
<ImageView
android:id="#+id/crdqrframe"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_alignTop="#+id/frameLayout1"
android:layout_toRightOf="#+id/frameLayout1"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="#drawable/border" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/bottomrltv"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_marginTop="10dp"
android:gravity="bottom" >
<Button
android:id="#+id/btnsend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="#+id/view"
android:layout_weight="1"
android:text="Send" />
<View
android:id="#+id/view"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_centerHorizontal="true" />
<Button
android:id="#+id/btnedit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/btnsend"
android:layout_toRightOf="#+id/view"
android:layout_weight="1"
android:text="Edit" />
</RelativeLayout>
Note: .xml file demonstrates whole interface, not only RelativeLayout.
If i understand you correctly you need to center imageview with id blankcard inside his parent relativelayout? Then you can set android:centerInParent='true'...
I am new to Android Programming(started yesterday, infact) and I cannot, for the life of me, get ScrollView to scroll. I have a bunch of buttons which won't all fit on the screen, so I tried to add a scroll function. However, this doesn't work. I am running an emulator if that helps. Here is my XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".UnleashedMainPageActivity" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/unleashed_Main" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/textView1"
android:text="#string/choose_Mod" />
<Button
android:id="#+id/button4"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView2"
android:layout_alignRight="#+id/textView2"
android:layout_below="#+id/textView2"
android:text="Applied Energistics" />
<Button
android:id="#+id/button1"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button4"
android:layout_alignRight="#+id/button4"
android:layout_below="#+id/button4"
android:text="Buildcraft" />
<Button
android:id="#+id/button2"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button1"
android:layout_alignRight="#+id/button1"
android:layout_below="#+id/button1"
android:text="Computer Craft" />
<Button
android:id="#+id/button3"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button2"
android:layout_alignRight="#+id/button2"
android:layout_below="#+id/button2"
android:text="Ender Storage" />
<Button
android:id="#+id/button5"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button3"
android:layout_alignRight="#+id/button3"
android:layout_below="#+id/button3"
android:text="Equivalent Exchange 3" />
<Button
android:id="#+id/button6"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button5"
android:layout_alignRight="#+id/button5"
android:layout_below="#+id/button5"
android:text="ExtraBiomes/Biomes O' Plenty" />
<Button
android:id="#+id/button7"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button6"
android:layout_alignRight="#+id/button6"
android:layout_below="#+id/button6"
android:text="Factorization" />
<Button
android:id="#+id/button8"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button7"
android:layout_alignRight="#+id/button7"
android:layout_below="#+id/button7"
android:text="Forestry" />
<Button
android:id="#+id/button9"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button8"
android:layout_alignRight="#+id/button8"
android:layout_below="#+id/button8"
android:text="IndustrialCraft 2" />
<Button
android:id="#+id/button10"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button9"
android:layout_alignRight="#+id/button9"
android:layout_below="#+id/button9"
android:text="MineFactory Reloaded" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/button10"
android:layout_alignLeft="#+id/button4"
android:layout_alignTop="#+id/button4"
android:orientation="vertical" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
</LinearLayout>
</RelativeLayout>
replace :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".UnleashedMainPageActivity" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/unleashed_Main" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/textView1"
android:text="#string/choose_Mod" />
<Button
android:id="#+id/button4"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView2"
android:layout_alignRight="#+id/textView2"
android:layout_below="#+id/textView2"
android:text="Applied Energistics" />
<Button
android:id="#+id/button1"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button4"
android:layout_alignRight="#+id/button4"
android:layout_below="#+id/button4"
android:text="Buildcraft" />
<Button
android:id="#+id/button2"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button1"
android:layout_alignRight="#+id/button1"
android:layout_below="#+id/button1"
android:text="Computer Craft" />
<Button
android:id="#+id/button3"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button2"
android:layout_alignRight="#+id/button2"
android:layout_below="#+id/button2"
android:text="Ender Storage" />
<Button
android:id="#+id/button5"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button3"
android:layout_alignRight="#+id/button3"
android:layout_below="#+id/button3"
android:text="Equivalent Exchange 3" />
<Button
android:id="#+id/button6"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button5"
android:layout_alignRight="#+id/button5"
android:layout_below="#+id/button5"
android:text="ExtraBiomes/Biomes O' Plenty" />
<Button
android:id="#+id/button7"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button6"
android:layout_alignRight="#+id/button6"
android:layout_below="#+id/button6"
android:text="Factorization" />
<Button
android:id="#+id/button8"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button7"
android:layout_alignRight="#+id/button7"
android:layout_below="#+id/button7"
android:text="Forestry" />
<Button
android:id="#+id/button9"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button8"
android:layout_alignRight="#+id/button8"
android:layout_below="#+id/button8"
android:text="IndustrialCraft 2" />
<Button
android:id="#+id/button10"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button9"
android:layout_alignRight="#+id/button9"
android:layout_below="#+id/button9"
android:text="MineFactory Reloaded" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
at first you don't have close tag for RelativeLayout.
and if you want scrollview work then you have to insert enough views in scrollview for fill screen height
I am trying to align buttons like simple calculator
But when i align buttons like that when i run it buttons can shift from desired location.
I can't understand what is problem.
here is code :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/activity_horizontal_margin"
android:gravity="fill_vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<Button
android:id="#+id/button11"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/button4"
android:layout_alignBottom="#+id/button4"
android:layout_alignLeft="#+id/button14"
android:layout_toLeftOf="#+id/button12"
android:onClick="#string/_onclick"
android:text="#string/_4" />
<Button
android:id="#+id/button16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/button4"
android:layout_toLeftOf="#+id/button5"
android:onClick="#string/_onclick"
android:text="#string/_9" />
<Button
android:id="#+id/button7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button6"
android:layout_alignParentBottom="true"
android:layout_marginBottom="16dp"
android:onClick="#string/_onclick"
android:text="#string/_" />
<Button
android:id="#+id/button8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#id/button7"
android:layout_alignLeft="#+id/button11"
android:layout_toLeftOf="#+id/button9"
android:onClick="#string/_onclick"
android:text="#string/_1" />
<Button
android:id="#+id/button10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/button7"
android:layout_toRightOf="#+id/button1"
android:onClick="#string/_onclick"
android:text="#string/_3" />
<Button
android:id="#+id/button6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/button7"
android:layout_alignLeft="#+id/button4"
android:onClick="#string/_onclick"
android:text="#string/_jam" />
<Button
android:id="#+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/button12"
android:layout_alignBottom="#+id/button12"
android:layout_alignLeft="#+id/button5"
android:onClick="#string/_onclick"
android:text="#string/_menha" />
<Button
android:id="#+id/button5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/button16"
android:layout_alignBottom="#+id/button16"
android:layout_alignLeft="#+id/button3"
android:onClick="#string/_onclick"
android:text="#string/_zarb" />
<Button
android:id="#+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/button5"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:onClick="#string/_onclick"
android:text="#string/_taghsim" />
<Button
android:id="#+id/button14"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/button11"
android:layout_toLeftOf="#+id/button12"
android:onClick="#string/_onclick"
android:text="#string/_7" />
<Button
android:id="#+id/button15"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/button13"
android:layout_alignLeft="#+id/button12"
android:layout_toLeftOf="#+id/button13"
android:onClick="#string/_onclick"
android:text="#string/_8" />
<Button
android:id="#+id/button9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/button7"
android:layout_alignLeft="#id/button12"
android:layout_alignTop="#id/button10"
android:layout_toLeftOf="#+id/button10"
android:onClick="#string/_onclick"
android:text="#string/_2" />
<Button
android:id="#+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/button3"
android:layout_alignBottom="#+id/button3"
android:layout_toLeftOf="#+id/button3"
android:layout_toRightOf="#+id/button1"
android:onClick="#string/_onclick"
android:text="#string/c" />
<Button
android:id="#+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/button14"
android:layout_alignLeft="#+id/button14"
android:layout_alignParentBottom="false"
android:layout_alignParentRight="false"
android:layout_alignRight="#+id/button15"
android:layout_alignWithParentIfMissing="false"
android:layout_centerInParent="false"
android:onClick="#string/_onclick"
android:text="#string/ce" />
<Button
android:id="#+id/button17"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/button7"
android:layout_alignBottom="#+id/button7"
android:layout_alignRight="#+id/button10"
android:layout_toRightOf="#+id/button9"
android:onClick="#string/_onclick"
android:text="#string/_dot" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button1"
android:layout_alignParentTop="true"
android:layout_marginLeft="17dp"
android:layout_marginTop="59dp"
android:textSize="20sp"
tools:ignore="SpUsage" />
<Button
android:id="#+id/button13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#id/button10"
android:layout_alignBaseline="#+id/button12"
android:layout_alignBottom="#+id/button12"
android:layout_alignLeft="#+id/button16"
android:layout_below="#id/button16"
android:layout_toLeftOf="#id/button4"
android:onClick="#string/_onclick"
android:text="#string/_6" />
<Button
android:id="#+id/Button01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/button8"
android:layout_toLeftOf="#+id/button17"
android:onClick="#string/_onclick"
android:text="#string/_0" />
<Button
android:id="#+id/button12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/button10"
android:layout_toLeftOf="#+id/button13"
android:onClick="#string/_onclick"
android:text="#string/_5" />
this is screenshot of my problems:
http://i39.tinypic.com/xm04lz.jpg
http://i42.tinypic.com/ibgmk3.jpg
please help me how can i solve the problem
Why are you making your life so difficult? Stop this alignment madness and use LinearLayouts. Create a LinearLayout and put the 5 rows of buttons inside, with each row as LinearLayout. Then use the layout_weight parameter to add them the same (or desired) width.
Example:
<LinearLayout>
<LinearLayout>
Button Button Button Button
</LinearLayout>
<LinearLayout>
Button Button Button Button
</LinearLayout>
....
</LinearLayout>