How show buttons as if they are attached together in android - android

I want to show the customized buttons as if they are attached. Here is what I got so far:
<RelativeLayout
android:id="#+id/linearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.15"
android:orientation="horizontal"
android:scaleType="fitXY" >
<Button
android:id="#+id/Button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btntoggle_selector"
android:textColor="#android:color/white" />
<Button
android:id="#+id/Button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="62dp"
android:background="#drawable/btntoggle_selector"
/>
</RelativeLayout>
By the above code they are always showing as if there is some gap between them. How can I correct it?

How about you set the leftMargin to some negative value?
<Button
android:id="#+id/Button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btntoggle_selector"
android:textColor="#android:color/white" />
<Button
android:id="#+id/Button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="-5dp" //Modify this value to make them as close as possible
android:background="#drawable/btntoggle_selector"
/>

Related

Style Radio Group Android

I want ask how to we can design Radio Group in Android like this picture
"My Style"
I'm design XML like this :
<RadioGroup
android:layout_below="#+id/btnGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:id="#+id/rdiEasy"
android:text="EASY"
android:layout_alignParentLeft="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<RadioButton
android:id="#+id/rdiMedium"
android:text="MEDIUM"
android:layout_marginRight="8dp"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:id="#+id/rdiHard"
android:text="HARD"
android:layout_alignParentLeft="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<RadioButton
android:id="#+id/rdiHardest"
android:text="HARDEST"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
</RadioGroup>
I'm use RadioButtonGroup wrap 2 RelativeLayout , each RelativeLayout contain two Radio Button. But with this design , i can't choose only one Radio Button , still can choose multi radio button. So anyone can help me how to design Radio Button with this design but just only choose one option.
I think this will work for you
https://gist.github.com/ishitcno1/9544243
Use this code it work perfect.
<RelativeLayout
android:id="#+id/rl1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true">
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:orientation="horizontal"
android:transitionGroup="true">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="30dp">
<RadioButton
android:id="#+id/rdiEasy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Easy" />
<RadioButton
android:id="#+id/rdiHard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hard" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="30dp">
<RadioButton
android:id="#+id/rdiMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/rdiEasy"
android:text="Medium" />
<RadioButton
android:id="#+id/rdiHardest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/rdiHard"
android:text="Hardest" />
</LinearLayout>
</RadioGroup>
</RelativeLayout>
Try this code without using layouts inside radiogroup.and try to achieve the desired pattern by setting gravity,like this and check if radio button is selected only one or multiple
<RadioGroup
android:id="#+id/radioGroup"
android:layout_width="500dp"
android:layout_height="250dp"
android:layout_weight=".07"
android:gravity="center">
<RadioButton
android:id="#+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|top"
android:layout_marginLeft="5dp"
android:text="New RadioButton" />
<RadioButton
android:id="#+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|top"
android:layout_marginRight="5dp"
android:text="New RadioButton" />
<RadioButton
android:id="#+id/radioButton4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|left"
android:layout_marginLeft="5dp"
android:text="New RadioButton" />
<RadioButton
android:id="#+id/radioButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_marginRight="5dp"
android:text="New RadioButton" />
</RadioGroup>

Scrollview can only host one child

I can't figure out how to get these radio groups/text views into a scrollview. Can anyone help me? Heres what i've tried but I keep getting the error scrollview can only host one child and I don't know how to fix it.
<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"
tools:context=".ContactSettingsActivity" >
<RelativeLayout
android:id="#+id/navbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#color/navbar_background" >
<ImageButton
android:id="#+id/imageButtonList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:layout_toLeftOf="#+id/imageButtonMap"
android:src="#drawable/contactlisticon" />
<ImageButton
android:id="#+id/imageButtonMap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="#drawable/mapicon" />
<ImageButton
android:id="#+id/imageButtonSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:layout_toRightOf="#+id/imageButtonMap"
android:src="#drawable/settingsicon" />
</RelativeLayout>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/navbar">
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:text="Sort Contact By:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<RadioGroup
android:id="#+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView1"
android:layout_marginLeft="35dp"
android:layout_marginTop="10dp"
>
<RadioButton
android:id="#+id/radioName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="Name" />
<RadioButton
android:id="#+id/radioCity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="City" />
<RadioButton
android:id="#+id/radioBirthday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Birthday" />
</RadioGroup>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/radioGroup1"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:text="Sort Order:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<RadioGroup
android:id="#+id/radioGroup2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="35dp"
android:layout_marginTop="10dp"
android:layout_below="#+id/textView2" >
<RadioButton
android:id="#+id/radioAscending"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="Ascending" />
<RadioButton
android:id="#+id/radioDescending"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Descending" />
</RadioGroup>
</ScrollView>
</RelativeLayout>
Choose a single container layout for all the child items you want to appear in a ScrollView. Most of the time this will be a LinearLayout to get them stacked vertically, but it could really be any view you want. You just need to choose one and arrange the children in it manually.
Add a layout inside scroll view and move the ui widgets(textview and radiogroup) inside that layout.

Android layout - How to make the controls appear to the left/right without padding?

I have defined 3 controls on my screen, placed in the following order:
button
- textView
- button
I want to place the first button on the left side and place the textView in the middle. The second button should be on the right side.
However, I cannot find a way to force the buttons to stick to the left/right side and for the textView too stick to the middle.
This is the code:
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="<<"
android:id="#+id/button2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/TodayDataTextView"
android:text="Today Data"
android:textAlignment="center"
android:textColor="#0000ff"
android:background="#00000000"
android:layout_margin="5dp"
android:textSize="20dp"
android:textStyle="bold|italic" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=">>"
android:id="#+id/button" />
</LinearLayout>
And this is the screenshot:
And this is what I want to have (without the padding):
Try this code :
<RelativeLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="<<"
android:id="#+id/button2"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/TodayDataTextView"
android:gravity="center_vertical"
android:text="Today Data"
android:textAlignment="center"
android:textColor="#0000ff"
android:background="#00000000"
android:textSize="20dp"
android:textStyle="bold|italic"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=">>"
android:id="#+id/button"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
Output :
set layoutgravity and gravity as left, center and right respectively for all the three widgets
You can try a RelativeLayout. Like this:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="<<"
android:layout_alignParentLeft="true"
android:id="#+id/button2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/TodayDataTextView"
android:text="Today Data"
android:textAlignment="center"
android:layout_centerHorizontal="true"
android:textColor="#0000ff"
android:background="#00000000"
android:layout_margin="5dp"
android:textSize="20dp"
android:textStyle="bold|italic" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=">>"
android:layout_alignParentRight="true"
android:id="#+id/button" />
</RelativeLayout>
Please use a Relative Layout instead of a LinearLayout.
Add to Button
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
Add to TextView
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
Add to the Right Button
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
You could use layout weights to get exactly what you are looking for:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="<<"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Today Data"
android:textAlignment="center"
android:textStyle="bold|italic"
/>
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="<<"
android:id="#+id/button"
/>
Remember that Android makes two passes when determining the size and position of the components in a layout. The first pass uses the layout_width and layout_height settings. In this case it is wrap_content for most of the widgets which will make them their "natural" size to fit their content. The second pass uses the layout_weight attribute to allocate any remaining pixels. Given that this is a horizontal linear layout, those pixels will be allocate to the horizontal size of the widgets. Only the TextView specifies a weight attribute, so it will get 100% of the remaining pixels.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.20"
android:gravity="left">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="<<" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.60"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="data"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.20"
android:gravity="right">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="<<" />
</LinearLayout>
</LinearLayout>
This is also working
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="5">
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="0sp"
android:layout_weight="1"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:text="<<"
android:id="#+id/button2" />
<TextView
android:layout_width="0sp"
android:layout_weight="3"
android:layout_height="wrap_content"
android:id="#+id/TodayDataTextView"
android:text="Today Data"
android:textAlignment="center"
android:layout_gravity="center"
android:gravity="center"
android:textColor="#0000ff"
android:background="#00000000"
android:layout_margin="5dp"
android:textSize="20dp"
android:textStyle="bold|italic" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="0sp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:text=">>"
android:id="#+id/button" />
</LinearLayout>

Android Button Panel

I am creating an android app, and need a navigation panel at the bottom of the screen, which the user can use to navigate through the app, and skip any steps they don't wish to make, for example they could just select steps 5 and 10 and leave the rest out. This will be a panel will 7 buttons across by 3 buttons down, giving 21 buttons. The XML code is below;
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_alignParentBottom="true"
android:weightSum="3">
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button2"
android:layout_below="#+id/button2"
android:weightSum="7">
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="01" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="02" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="03" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="04" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="05" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="06" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="07" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button2"
android:layout_below="#+id/button2"
android:weightSum="7">
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="08" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="09" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="10" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="11" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="12" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="13" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="14" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/button2"
android:layout_below="#+id/button2"
android:weightSum="7">
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="15" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="16" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="17" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="18" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="19" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="20" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="Previous"
android:text="21" />
</LinearLayout>
</LinearLayout>
The are approximately 50 classes (or different screens in this app), and this button panel needs to be present on each of them. Each button will also have to have an onClickListener to tell it what to do.
My question relates to 2 points, the first in relation to the XML file.
As this 'button panel' will be present on every screen, is there a way of creating a master XML file that can be used to create this panel on every screen, rather than having to re write identical code 50 times in one app-which seems highly in efficient.
The second points relates to the onClickListener. Again, is it possible to create a master listener that will apply to this button panel every time it appears. I will make an master listener class that will handle the events, but without a proper master class, each individual class will have to have the listener set for every individual button in every class-which again seems highly inefficient as there will be significant repetition of identical code in 50 classes.
I have considered using ice cream sandwich, but this does not quite seem to meet my needs.
Create a Re-usable Layout
Create a separate Navigation panel layout.
Suppose this is your navigation panel layout ( panelbar.xml)
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width=”match_parent”
android:layout_height="wrap_content"
android:background="#color/footerbar_bg">
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/gafricalogo" />
Just Include it in all your XML
Now include your navigation panel in each XML like this.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:background="#color/app_bg"
android:gravity="center_horizontal">
<include layout="#layout/panelbar"/>
<TextView android:layout_width=”match_parent”
android:layout_height="wrap_content"
android:text="#string/hello"
android:padding="10dp" />
...
source : For more detail info
You can create an xml file with button panel separately, and use include tag in other xmls like this:
<include
android:id="#+id/panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
layout="#layout/button_panel" />
As far as onClickListener is concerned, you can check if this post helps you.

Best way to force ListView to bottom of the screen

I have a layout where I want the ListView to be at the bottom of the screen on every device. On the Android Studio preview it looks fine, but on my device it looks like this:
When it should look like this:
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:id="#+id/imageView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="65dp"
android:src="#drawable/test"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Full Name"
android:id="#+id/textView"
android:layout_below="#+id/imageView"
android:layout_centerHorizontal="true"
android:paddingTop="7dp"
android:textStyle="bold"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="University"
android:id="#+id/textView2"
android:layout_below="#+id/textView"
android:layout_centerHorizontal="true" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="#+id/button"
android:layout_centerVertical="true"
android:layout_toLeftOf="#+id/textView2" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="#+id/button2"
android:layout_alignTop="#+id/button"
android:layout_toRightOf="#+id/textView" />
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/customList"
android:layout_below="#+id/textView"
android:layout_centerHorizontal="true"
android:layout_marginTop="95dp" />
</RelativeLayout>
You should add android:layout_alignParentBottom to your ListView.
Well take your three button in one layout say yourButtonContainer and you can have listview with property
android:layout_alignParentBottom="true"
along with the property
android:layout_below="#+id/yourButtonContainer"

Categories

Resources