I tried adding a scroll view around everything on an activity layout but it gave me an error saying it can only be placed around one thing.
My activity, has a title textview then an image, then a description text view, and you can not read the whole description because its to long and goes below the edge of my screen. How can I make the whoel thing scrollable?
My xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/beerTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="40sp"
android:textStyle = "bold"
>
</TextView>
<ImageView android:id="#+id/image"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_margin="10dip"/>
<Button
android:id="#+id/buttonBrewery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
<Button
android:id="#+id/buttonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="#+id/beerDEscriptionTitle"
android:textStyle = "bold"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="20sp"
android:text="Description"
></TextView>
<TextView
android:id="#+id/beerDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="15sp"
></TextView>
</LinearLayout>
Try this:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<!-- TextView and other stuff -->
</LinearLayout>
</ScrollView>
Wrap the LinearLayout (height is wrap_content) with SrollView (height is fill_parent).
The "one thing" is your LinearLayout. Just wrap that in a ScrollView and you will encapsulate the layout for the entire activity.
Additionally, if you want to wrap just one elemtnet in a ScrollView all you have to do is put that element in it's own layout, like a linear or relative layout, and then that becomes the one element of your ScrollView
just use this
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scrollview"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/beerTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="40sp"
android:textStyle = "bold"
>
</TextView>
<ImageView android:id="#+id/image"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_margin="10dip"/>
<Button
android:id="#+id/buttonBrewery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
<Button
android:id="#+id/buttonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="#+id/beerDEscriptionTitle"
android:textStyle = "bold"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="20sp"
android:text="Description"
></TextView>
<TextView
android:id="#+id/beerDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="15sp"
></TextView>
</LinearLayout>
</ScrollView>
Related
I don't know how to set up the layout of the alignment? Maybe this is a simple question but i am no idea,And I'm a new Android developer.Please provide the way of thinking,Thank you!
This is my page to display hierarchical relationship.
This page is made up of two layout, parent and child:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/table_cell_bg_color">
<TextView
android:id="#+id/parent_task_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="40px"
android:paddingTop="6px"
android:paddingBottom="6px"
android:textSize="18sp"
android:textColor="#2B2B2B"
android:text="No data"/>
<ImageView
android:id="#+id/arrow_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:src="#drawable/ram_arrow_close"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/table_cell_bg_color" >
<TextView
android:id="#+id/child_task_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:paddingLeft="60px"
android:paddingTop="10px"
android:paddingBottom="10px"
android:textSize="18sp"
android:textColor="#2B2B2B"
android:text="No Data" />
<TextView
android:id="#+id/child_task_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:paddingLeft="60px"
android:paddingTop="10px"
android:paddingBottom="10px"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="#color/text_blue"
android:text="No Data"/>
<ImageView
android:id="#+id/arrow_child"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="0.3"
android:src="#drawable/ram_arrow_icon"/>
</LinearLayout>
Use this Code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/table_cell_bg_color">
<TextView
android:id="#+id/child_task_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#2B2B2B"
android:text="No Data" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/arrow_layout"
android:layout_toLeftOf="#+id/arrow_layout"
android:layout_toStartOf="#+id/arrow_layout"
android:paddingRight="10dp">
<TextView
android:id="#+id/child_task_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="#color/text_blue"
android:text="No Data"/>
</LinearLayout>
<LinearLayout
android:id="#+id/arrow_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:paddingRight="10dp">
<ImageView
android:id="#+id/arrow_child"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ram_arrow_icon"/>
</LinearLayout>
I thing you are using list view or recyclerview so you should use this view to repeat the content based on array size
Possible solutions for you.
Table Layout
Relative Layout
You can use with layout
android:gravity=""
and
android:layout_gravity=""
I am designing a layout for an activity where some contents like Textview, spinner and buttons are arranged in the upper part of the screen. I want to position image view to the bottom of the screen with a match_parent attribute to fill to the remaining bottom of the screen and it has become a challenge to me as the image view is filling to the bottom of the remaining part of the screen. This is the entire layout of the upper section/part of the screen
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ScrollView
android:layout_width="fill_parent"
android:background="#drawable/xxxVal"
android:padding="10dp"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView
android:id="#+id/dataVaues"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="25sp"
android:gravity="center_horizontal"
android:textColor="#000"
/>
<Spinner
android:id="#+id/spinBundle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6sp"
android:textColor="#000"
android:prompt="#string/_prompt" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="#000"
android:text="Plan" />
<TextView
android:id="#+id/bundle"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textSize="30sp"
android:textColor="#000"/>
<!-- android:inputType="phone" -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="#000"
android:text="PValue:" />
<TextView
android:id="#+id/value"
android:inputType="value"
android:layout_height="wrap_content"
android:textSize="30sp"
android:layout_width="match_parent"
android:textColor="#000"/>
<TextView
android:id="#+id/validValue"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Valid:"
android:textColor="#000000" />
<TextView
android:id="#+id/valid"
android:inputType="valid"
android:layout_height="wrap_content"
android:textSize="30sp"
android:layout_width="match_parent"
android:layout_marginBottom="10dp"
android:textColor="#ff0000"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical" >
<Button
android:id="#+id/proceed"
android:text="Proceed"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:textColor="#000"/>
<Button
android:id="#+id/data"
android:text="Check"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_marginTop="10dp"
android:textColor="#000"/>
</LinearLayout>
this is remaining part of the layout with a view flipper for an image that I want it to fit down to the remaining part of the screen but its not fitting as it shrinks up
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="3dp"
android:gravity="center_horizontal"
android:orientation="vertical" >
<ViewFlipper
android:id="#+id/flipper1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:flipInterval="5000"
android:inAnimation="#anim/slide_in_right"
android:outAnimation="#anim/slide_out_left" >
</ViewFlipper>
</LinearLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
please kindly assist!
Try adding the imageview to the Viewflipper like so:
<ViewFlipper
android:id="#+id/simpleViewFlipper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src=IMAGE />
</ ViewFlipper >
Having said that you might find some issues regarding swiping when using a viewflipper inside a scrollview
I'm trying to align 3 pictures in a LinearLayout so that one is centered at the top, another is at the bottom aligned to the left side and the last is at the bottom aligned to the right side. Pretty much like a pyramid. How could I do this? Can you provide an example?
i.e
X
X X
Use this one:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="#drawable/ic_launcher" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:orientation="horizontal" >
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_launcher" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" >
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_launcher" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
It will be more flexible if you do it in RelativeLayout but if you want to do it in LinearLayout here is the solution:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|center_horizontal"
android:src="#drawable/ic_launcher" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:orientation="horizontal" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_launcher" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_launcher" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
You need a RelativeLayout, not a LinearLayout.
Image A must specify the attribute
android:layout_alignParentTop="true".
Image B must specify the attributes
android:layout_alignParentBottom="true"
and
android:layout_alignParentLeft="true".
Image C must specify the attributes
android:layout_alignParentBottom="true"
and
android:layout_alignParentRight="true"
i created button and other...
but now when i want to create a three buttons green,red,blue they are not showing up i want them to be directly down the button1 but they are not showing up i wish you can help me this is the error im getting -xml documents must start and end within the same entity the error is showing in the last last last linearlayout
this is the code im having problem with
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="#+id/secondLine"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/Greetings"
android:textSize="20sp" />
<Button
android:id="#+id/Button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/hello" />
</LinearLayout>
<RelativeLayout
android:id="#+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
</RelativeLayout>
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="20dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/thirdLine"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_gravity="center"
android:background="#ff0000"
android:textColor="#000000"
android:text="red" />
<TextView
android:id="#+id/fourthLine"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_gravity="center"
android:background="#00ff00"
android:textColor="#000000"
android:text="green" />
<TextView
android:id="#+id/fifthLine"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_gravity="center"
android:background="#0000ff"
android:textColor="#000000"
android:text="blue" />
<RelativeLayout
android:id="#+id/relativeLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
</RelativeLayout>
</LinearLayout>
this is a picture for the red blue green buttons where to be while mine are down
https://www.dropbox.com/s/73grdc0iff3ql3u/Untitled.png
this is what i reached to till now but i want them to be equally distributed like the picture above
https://www.dropbox.com/s/73grdc0iff3ql3u/Untitled.png
you have not closed the below linear layout tag in your xml.
"<"LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="20dp"
android:orientation="horizontal" ">"
You need one more </LinearLayout> at the end of your xml file. At the minute, only 2 of the 3 LinearLayout's are being closed.
EDIT
The reason your Buttons are appearing at the bottom is because of this:
<RelativeLayout
android:id="#+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
</RelativeLayout>
I'm not sure what purpose this serves in your application, but removing that will fix your problem.
Replace your xml with following code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="10" >
<TextView
android:id="#+id/secondLine"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="20sp" />
<Button
android:id="#+id/Button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="HelloWord" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="5dp"
android:weightSum="10" >
<TextView
android:id="#+id/thirdLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3.3"
android:background="#ff0000"
android:text="red"
android:textColor="#000000"
android:gravity="center" />
<TextView
android:id="#+id/fourthLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3.4"
android:background="#00ff00"
android:text="green"
android:textColor="#000000"
android:gravity="center" />
<TextView
android:id="#+id/fifthLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3.3"
android:background="#0000ff"
android:text="blue"
android:textColor="#000000"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
Hope it will help you.
I have the following code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/itemLayoutView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="#dimen/list_view_layout_margin"
android:paddingRight="#dimen/list_view_layout_margin"
android:background="#color/yellow">
<LinearLayout
android:id="#+id/itemLinearLayoutView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/gameNameView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="#dimen/game_list_text_size" />
<TextView
android:id="#+id/gameCreationDateView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/gray"
android:textSize="#dimen/small_text_size"
android:textStyle="italic" />
</LinearLayout>
<LinearLayout
android:id="#+id/LinearLayoutView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/red"
android:orientation="horizontal" >
<Button
android:id="#+id/infoButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/info" />
<Button
android:id="#+id/deleteButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/delete" />
</LinearLayout>
</RelativeLayout>
The LinearLayout with id itemLinearLayoutView is the main layout that wrap everything in a row of listview. The problem I am having is that the second linear layout child does not take the height of the parent linear layout with id itemLinearLayoutView. Any solutions? or Problem with the code?
Your problem lies here:
android:layout_height="wrap_content"
This needs to be changed to "match_parent" in the LinearLayout which you want to be the parent's size. Also, you said
the second linear layout child does not take the height of the parent linear layout
These two layouts are not parents and children to one another. The parent is your RelativeLayout and both of your LinearLayouts are equivalent children of that RelativeLayout. Maybe this will help you debug any further problems you encounter.
just change the layout height to match parent . problem will be resolved.
<LinearLayout
android:id="#+id/itemLinearLayoutView"
android:layout_width="match_parent"
// use match_parent instead of wrap_content
android:layout_height="match_parent"
android:orientation="vertical" >
the layout needs to be nested within the first linear layout to take the parameters of it, and the value of the layout height needs to be changed. Code as Follows.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/itemLayoutView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="#dimen/list_view_layout_margin"
android:paddingRight="#dimen/list_view_layout_margin"
android:background="#color/yellow">
<LinearLayout
android:id="#+id/itemLinearLayoutView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/gameNameView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="#dimen/game_list_text_size" />
<TextView
android:id="#+id/gameCreationDateView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/gray"
android:textSize="#dimen/small_text_size"
android:textStyle="italic" />
<LinearLayout
android:id="#+id/LinearLayoutView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/red"
android:orientation="horizontal" >
<Button
android:id="#+id/infoButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/info" />
<Button
android:id="#+id/deleteButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/delete" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/itemLinearLayoutView"
android:layout_width="match_parent"
android:layout_height="match_parent" <!-- you should use match_parent here -->
android:orientation="vertical" >
// try this way i have used LinearLayout as parent rather than RelativeLayout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/itemLayoutView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingLeft="#dimen/list_view_layout_margin"
android:paddingRight="#dimen/list_view_layout_margin"
android:background="#color/yellow">
<LinearLayout
android:id="#+id/itemLinearLayoutView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/gameNameView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="#dimen/game_list_text_size" />
<TextView
android:id="#+id/gameCreationDateView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/gray"
android:textSize="#dimen/small_text_size"
android:textStyle="italic" />
</LinearLayout>
<LinearLayout
android:id="#+id/LinearLayoutView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="right"
android:background="#color/red"
android:orientation="horizontal" >
<Button
android:id="#+id/infoButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/info" />
<Button
android:id="#+id/deleteButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/delete" />
</LinearLayout>
</LinearLayout>