My imageview is not getting fill-parent - java

My image view doesn't set fill-parent in my layout. I have some images with a size of 500*375 and 300*215. I set my image view to fill-parent completely, but it appears in the center of the page without a complete fill..
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:id="#+id/main_matn_layout"
android:background="#drawable/backmainmatn"
android:layout_height="match_parent">
<ir.adad.AdView
android:id="#+id/ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/star"
android:layout_toRightOf="#+id/main_matn_i_next"
android:layout_toLeftOf="#+id/main_matn_i_pre"
android:layout_above="#+id/imgb"
/>
<ImageButton android:id="#+id/imgb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="center"
android:background="#drawable/star"
android:layout_toRightOf="#+id/main_matn_i_next"
android:layout_toLeftOf="#+id/main_matn_i_pre"
/>
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#+id/ad"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/main_matn_titr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:gravity="right"
android:textColor="#android:color/black"
android:layout_marginTop="20dp"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="30sp"/>
<ImageView
android:id="#+id/main_matn_share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:src="#drawable/share"/>
<ImageView
android:id="#+id/main_matn_img"
android:layout_width="fill_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="fill_parent"
/>
<TextView
android:id="#+id/main_matn_matn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_margin="20dp"
android:textColor="#android:color/black"
android:gravity="right"
android:text="TextView"/>
</LinearLayout>
</ScrollView>
<ImageView
android:id="#+id/main_matn_i_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:src="#drawable/back"/>
<ImageView
android:id="#+id/main_matn_i_pre"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:src="#drawable/next"/>
I want to make my imageview fill-parent.
<ImageView
android:id="#+id/main_matn_img"
android:layout_width="fill_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="fill_parent"
/>
In the emulator it appears correctly, but when I run my project it doesn't.

First off, fill_parent is deprecated, you should use match_parent instead.
That said, I'm guessing this could be a scaleType issue. To check that your ImageView is actually filling its parent, I suggest setting a background color:
android:background="#FF0000"
To make sure the bitmap actually fills its ImageView container, try the scaleType which better fits your needs:
android:scaleType="centerCrop"

Related

RecycleView onclick not work for first item while set height to match_parent

I have recycleView in my project . I have a imageview (handle like action), while i want to like my post it click and when I want to dislike my post , Just my first item click .
I change haight of my item to match parent, it works for the rest of items . But my view is match parent and appearance of layout is not good.
here is my xml :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="2dp"
android:layout_marginStart="2dp"
android:layout_marginTop="2dp"
>
<ImageView
android:id="#+id/imageView"
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:adjustViewBounds="true"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="false"
android:maxHeight="160dp"
android:scaleType="centerCrop" />
<View
android:layout_width="match_parent"
android:layout_height="180dp"
android:background="#drawable/gradient_background" />
<TextView
android:id="#+id/post_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:ellipsize="marquee"
android:gravity="right"
android:maxLines="2"
android:paddingBottom="4dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
android:shadowColor="#color/text_shadow"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="2"
android:textColor="#color/white"
android:textSize="18sp"
tools:text="Title" />
<TextView
android:id="#+id/post_category"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#id/post_title"
android:paddingBottom="4dp"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:shadowColor="#color/text_shadow"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="2"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="14sp"
tools:text="Hello World" />
<ProgressBar
android:id="#+id/progress"
style="#android:style/Widget.DeviceDefault.Light.ProgressBar.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="visible"
tools:visibility="visible" />
<LinearLayout
android:id="#+id/actions_ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#id/imageView"
android:layout_alignParentRight="true"
android:gravity="start"
android:orientation="horizontal">
<ImageView
android:id="#+id/share_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="16dp"
android:tint="#android:color/white"
app:srcCompat="#drawable/ic_share" />
<ImageView
android:id="#+id/like"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="16dp"
/>
</LinearLayout>
</RelativeLayout>
If I put wrap_content ,it doesn't work correct and just first item is clickable.
Any idea?
In adapter view, you should always keep width as wrap_content. If still you require width to be match_parent, please post your question in understandable words.

How to add text above it?

I'm making a layout:
Here is a code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#373c5c"
android:gravity="center_vertical"
android:orientation="vertical" >
<LinearLayout android:id="#+id/list_offer_item_container"
android:layout_marginTop="15dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/shape"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:id="#+id/imgcreditcompany"
android:layout_width="36dp"
android:layout_marginRight="4dp"
android:layout_marginTop="0dp"
android:layout_marginBottom="0dp"
android:contentDescription="#string/app_name"
android:layout_height="36dp" />
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:gravity="start"
android:orientation="vertical" >
<TextView
android:id="#+id/txtname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="1dp"
android:textColor="#48899f"
android:textSize="#dimen/textsizeearncredit_title"
android:text="Name"
android:textAllCaps="false"
android:textStyle="normal|bold" />
<TextView
android:id="#+id/txtdesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="1dp"
android:maxLines="1"
android:textColor="#80869c"
android:textSize="#dimen/textsizeearncredit_desc"
android:text="This is a description of the offer and this is just a demo to show off 3 lines stacking correctly on top of each other"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginRight="20dp"
android:gravity="end"
android:layout_gravity="center_vertical">
<TextView android:id="#+id/list_offer_badge_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/list_offer_item_container"
android:textColor="#color/md_amber_700"
android:textSize="12sp"
android:visibility="gone"
android:text=""/>
</LinearLayout>
<ImageView
android:id="#+id/nextArrow"
android:layout_alignParentRight="true"
android:tint="#color/md_grey_300"
android:rotation="180"
android:layout_width="32dp"
android:visibility="gone"
android:layout_marginRight="16dp"
android:layout_gravity="center"
android:layout_centerVertical="true"
android:layout_height="32dp"
android:contentDescription="#string/app_name"
android:padding="#dimen/two" />
</LinearLayout>
</RelativeLayout>
How to add an text above the 'button style' linear layout?
I want for example "Hello dear user! Check it below".
Where put textview, where add more layout or whatever?
It is very simple!
You have to add TextView, with id (text, for example) and, in your LinearLayout you need to add line android:layout_below="#+id/text". Optional, you can specify attribute android:layout_alignParentTop="true" in TextView.
Just use code below:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#373c5c"
android:gravity="center_vertical"
android:orientation="vertical" >
<TextView
android:id="#+id/text"
android:text="Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
/>
<LinearLayout android:id="#+id/list_offer_item_container"
android:layout_below="#+id/text"
android:layout_marginTop="15dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/shape"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:id="#+id/imgcreditcompany"
android:layout_width="36dp"
android:layout_marginRight="4dp"
android:layout_marginTop="0dp"
android:layout_marginBottom="0dp"
android:contentDescription="#string/app_name"
android:layout_height="36dp" />
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:gravity="start"
android:orientation="vertical" >
<TextView
android:id="#+id/txtname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="1dp"
android:textColor="#48899f"
android:textSize="#dimen/textsizeearncredit_title"
android:text="Name"
android:textAllCaps="false"
android:textStyle="normal|bold" />
<TextView
android:id="#+id/txtdesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="1dp"
android:maxLines="1"
android:textColor="#80869c"
android:textSize="#dimen/textsizeearncredit_desc"
android:text="This is a description of the offer and this is just a demo to show off 3 lines stacking correctly on top of each other"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginRight="20dp"
android:gravity="end"
android:layout_gravity="center_vertical">
<TextView android:id="#+id/list_offer_badge_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/list_offer_item_container"
android:textColor="#color/md_amber_700"
android:textSize="12sp"
android:visibility="gone"
android:text=""/>
</LinearLayout>
<ImageView
android:id="#+id/nextArrow"
android:layout_alignParentRight="true"
android:tint="#color/md_grey_300"
android:rotation="180"
android:layout_width="32dp"
android:visibility="gone"
android:layout_marginRight="16dp"
android:layout_gravity="center"
android:layout_centerVertical="true"
android:layout_height="32dp"
android:contentDescription="#string/app_name"
android:padding="#dimen/two" />
</LinearLayout>
</RelativeLayout>
Above
<LinearLayout android:id="#+id/list_offer_item_container"
put your TextView or whatever you want. So something like
<TextView android:id="#+id/myTV"
// other attributes />
Then in
<LinearLayout android:id="#+id/list_offer_item_container"
add android:layout_below="#id/myTV"
By default, RelativeLayout puts it's elements at the top-left until you specify otherwise. So adding this will put your LinearLayout below the TextView.
I think the confusion is on how RelativeLayout and LinearLayout work. You have orientation in your RelativeLayout which does nothing. RelativeLayout puts it's elements in the order you tell it by the attributes such as layout_below and layout_above. LinearLayout, however, adds them in the order in which they show in the xml file which is why orientation matters in LinearLayout but not RelativeLayout.
You'll want to look at RelativeLayout.LayoutParams and other parts of the documentation to better understand how the layouts work and which is best in your specific cases.

Exception raised during rendering: ScrollView can host only one direct child

how to insert image and textview in scroll view..
<ScrollView
android:id="#+id/SView"
android:layout_below="#id/tvNama"
android:layout_marginBottom="25dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_above="#+id/sound">
<TextView android:id="#+id/tvketerangan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:text="keterangan"
android:textStyle="bold"
android:textColor="#000000"
android:textSize="16sp"/>
<ImageView
android:id="#+id/imageview"
android:layout_width="300dp"
android:layout_height="300dp"
android:src="#drawable/sa"
android:layout_below="#+id/tvketerangan"
android:layout_centerHorizontal="true"/>
</ScrollView>
this my code.. if i delete imageview,, textview is show and if i delete textview imageview is show...
Piggy backing off what GiantTree said, you should change your layout xml to something like this:
<ScrollView
android:id="#+id/SView"
android:layout_below="#id/tvNama"
android:layout_marginBottom="25dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#+id/sound">
<FrameLayout
android:id="#+id/scroll_view_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView android:id="#+id/tvketerangan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:text="keterangan"
android:textStyle="bold"
android:textColor="#000000"
android:textSize="16sp"/>
<ImageView
android:id="#+id/imageview"
android:layout_width="300dp"
android:layout_height="300dp"
android:src="#drawable/sa"
android:layout_below="#+id/tvketerangan"
android:layout_centerHorizontal="true"/>
</FrameLayout>
</ScrollView>

How to fix the button position in Linear Layout

I define two components (One text View and one Button) in Linear layout.
<LinearLayout
android:id="#+id/layout_1"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/edit_view1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize = "15sp"
android:layout_weight="5"
android:layout_marginTop="20dp"
android:layout_alignParentLeft="true"
android:gravity="center"
android:hint="Write Greeting" />
<ImageButton
android:id="#+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_toRightOf="#+id/edit_view1"
android:layout_alignParentRight="true"
android:background="#android:color/transparent"
android:src="#drawable/e301"/>
</LinearLayout>
If I write long text, the position of my ImageButton is changed. I want to fix the position. Any suggestion?
Replace your layout contents as :
<LinearLayout
android:id="#+id/layout_1"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/edit_view1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize = "15sp"
android:layout_weight="5"
android:layout_marginTop="20dp"
android:gravity="center"
android:hint="Write Greeting" />
<ImageButton
android:id="#+id/imageButton1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:color/transparent"
android:src="#drawable/e301"/>
</LinearLayout>
You can't use RelativeLayout's properties of alignment inside Linear layout.
See your modified code:
<LinearLayout
android:id="#+id/layout_1"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="3"
xmlns:android="http://schemas.android.com/apk/res/android">
<TextView
android:singleLine="false"
android:id="#+id/edit_view1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize = "15sp"
android:layout_marginTop="20dp"
android:text="etegtdrgrgbvcvbghgfffffffffffffffffffffffffffff"
android:gravity="center"
android:hint="Write Greeting"
android:layout_weight="2"/>
<ImageButton
android:id="#+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:color/transparent"
android:src="#drawable/ic_launcher"
/>
</LinearLayout>
Keep layout width as 0 dp using weight and weightSum, so it will adjust. Also, keep sengleLine as false for textview.
Output:
Hope this helps.
Try below code:-
<LinearLayout
android:id="#+id/layout_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/edit_view1"
android:layout_width="0dp"
android:layout_weight="5"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="20dp"
android:gravity="center"
android:hint="Write Greeting"
android:textSize="15sp" />
<ImageButton
android:id="#+id/imageButton1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_toRightOf="#+id/edit_view1"
android:background="#android:color/transparent"
android:src="#drawable/e301" />
</LinearLayout>
Using weight then you must have width = 0dp(horizontal) and heigth = 0dp(vertically)
Use weights: you didn't define weightSum of layout so your weights are now useless. Set parent layout's weightSum to 6 (in order to use your values) or 100 and set children's weights as percents. And change children views' widths to 0dp.
[optional] Set button's width to match_parent so it'll take all remaining space.
In LinearLayout layout_toRightOf, layout_alignParentRight, layout_alignParentLeft are redundant. Use gravity for children views instead. (for Button it'll be `gravity="right").
Use the below coding. Tell me if you want better alignment. I have used default default image for alignment. If you want better than this, then give buttom image also.
<LinearLayout
android:id="#+id/layout_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" >
<TextView
android:id="#+id/edit_view1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="20dp"
android:gravity="center"
android:hint="Write Greeting dfdsfdsfsdfadsfdfadf"
android:textSize="15sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="3" >
<ImageButton
android:id="#+id/imageButton1"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:color/transparent"
android:src="#drawable/ic_launcher" />
</RelativeLayout>
</LinearLayout>

how to add three button at bottom layout

i want to add three buttons at the bottom like this image
below listview which is equal size my code is below help me how do i add this three button in my layout this is my screen
<?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="wrap_content"
android:background="#ffffff"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/border" >
<ImageView
android:id="#+id/test_button_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:paddingTop="5dp"
android:src="#drawable/icon" >
</ImageView>
<TextView
android:id="#+id/test_button_text2"
android:layout_width="wrap_content"
android:paddingTop="10dp"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/test_button_image"
android:paddingLeft="10dp"
android:layout_toRightOf="#+id/test_button_image"
android:text="San Diego Unified"
android:textColor="#000000"
android:textSize="25sp" >
</TextView>
<TextView
android:id="#+id/test_button_text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:layout_alignLeft="#+id/test_button_text2"
android:layout_below="#+id/test_button_text2"
android:paddingBottom="10dp"
android:text="SCHOOL DISTRICT"
android:textColor="#000000" >
</TextView>
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="40dp"
android:background="#drawable/border1"
android:orientation="horizontal" >
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:layout_weight="1"
android:ellipsize="end"
android:paddingLeft="10dp"
android:singleLine="true"
android:text="HEALTHY BODIES HEALTHY MINDS "
android:textColor="#000000"
android:textStyle="bold"
android:textSize="11sp" />
<ImageButton
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:paddingRight="5dp"
android:padding="5dp"
android:background = "#null"
android:src="#drawable/facebook" />
<ImageButton
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:background = "#null"
android:padding="5dp"
android:src="#drawable/twitter"
android:text="Button Text" />
</LinearLayout>
<RelativeLayout
android:layout_marginTop="10dp"
android:background="#00FFFF"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<EditText
android:id="#+id/editText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:hint="Search School By Name"
android:layout_centerVertical="true" >
</EditText>
<ImageView
android:id="#+id/imageView1"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/editText1"
android:layout_alignBottom="#+id/editText1"
android:layout_alignRight="#+id/editText1"
android:src="#drawable/title_search" />
</RelativeLayout>
<TextView
android:id="#+id/txtCaption"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:paddingBottom="3dp"
android:paddingLeft="10dp"
android:paddingTop="3dp"
android:text="SELECT A SCHOOL TO VIEW LUNCH OR BREAKFAST MENUS"
android:textColor="#000000"
android:textSize="10sp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/lytContent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/txtCopyright"
android:layout_marginTop="15dp"
android:background="#drawable/border2"
android:layout_below="#+id/lytTitlebar"
android:orientation="vertical" >
<ListView
android:id="#+id/listMainMenu"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:listSelector="#drawable/listview_selector"
android:dividerHeight="1dip"
android:fadeScrollbars="true" />
</LinearLayout>
</LinearLayout>
Take one linear layout below listview and give its orientation as horizontal and then add three textview one after the other with a seperator(i.e using View) and then put a click event on each and every textview and use it and put that linear layout gravity = bottom.
Here is the simple solution...
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#drawable/border" >
<Button 1>
<Button 2>-center horizontal and center vertical
<Button 3>-align parent right- true
Add what further properties you want to add in button.

Categories