This is my coding i have added a toolbar and i want the data below to scroll but its scrolling entirely.I Tried many solution in SO but still its of No use.Pls check and if found any error help me
Thanks in Advance
<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="com.agna.hrm_sainmarks.Address" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/White"
android:orientation="vertical" >
<include
android:id="#+id/emergencytoolbar"
layout="#layout/emergency_toolbar" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/name"
android:textSize="18dp" />
<TextView
android:id="#+id/primname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="Ajith Kumar"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View01"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/Hrmbg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/relationship"
android:textSize="18dp" />
<TextView
android:id="#+id/primrelationship"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="Brother"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View02"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/Hrmbg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/phone"
android:textSize="18dp" />
<TextView
android:id="#+id/primphone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="9998885231"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View03"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/Hrmbg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/taddress"
android:textSize="18dp" />
<TextView
android:id="#+id/primaddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="78,Muthu nagar 3rd Street,Coimbatore-44"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View04"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/Hrmbg" />
</ScrollView>
</LinearLayout>
</RelativeLayout>
emergency_toolbar
<?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="match_parent"
android:orientation="vertical" >
<!-- <android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#color/Hrmtool"
android:minHeight="?attr/actionBarSize"
android:theme="#style/ThemeOverlay.AppCompat.Dark"
android:titleTextColor="#color/Red" > -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:textColor="#color/Black"
android:weightSum="2"
>
<Button
android:id="#+id/pemergency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:clickable="#color/Hrmbg"
android:layout_weight="1"
android:textSize="18dp"
android:text="#string/pemergency"
android:textColor="#color/Black" />
<Button
android:id="#+id/semergency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:clickable="#color/Hrmbg"
android:layout_weight="1"
android:textSize="18dp"
android:text="#string/semergency"
android:textColor="#color/Black" />
</LinearLayout>
<!-- </android.support.v7.widget.Toolbar> -->
</RelativeLayout>
You need to do just few changes.
In emergency_toolbar.xml change the layout_height of RelativeLayout and LinearLayout to wrap_content.
In activity_main.xml put <include.... code outside LinearLayout and Inside of RelativeLayout.
You have to add LinearLayout just after ScrollView to wrap WHOLE fields as ScrollView can hold only one DIRECT CHILD.
Most important point: Add too many address field as you can see SCROLL at runtime. Just copy-paste address field and change the ids field of them.
Below is screen shot, which I have got as Outcome. And See this CodeLink.
Hope this will help.
ScrollView hold only one view as Childview try this code
<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="com.agna.hrm_sainmarks.Address">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/White"
android:orientation="vertical">
<include
android:id="#+id/emergencytoolbar"
layout="#layout/emergency_toolbar" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/name"
android:textSize="18dp" />
<TextView
android:id="#+id/primname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="Ajith Kumar"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View01"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/Hrmbg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/relationship"
android:textSize="18dp" />
<TextView
android:id="#+id/primrelationship"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="Brother"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View02"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/Hrmbg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/phone"
android:textSize="18dp" />
<TextView
android:id="#+id/primphone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="9998885231"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View03"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/Hrmbg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/taddress"
android:textSize="18dp" />
<TextView
android:id="#+id/primaddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="78,Muthu nagar 3rd Street,Coimbatore-44"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View04"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/Hrmbg" />
</LinearLayout>
</ScrollView>
</LinearLayout>
As Scroll View can hold only one direct child.You need to define it above Your Main Linear Layout. Also use Scroll Bars Property in Scroll View.
EDIT :
Move your Tool Bar Layout above Scroll View.
Try this code.
<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="com.agna.hrm_sainmarks.Address">
<include
android:id="#+id/emergencytoolbar"
layout="#layout/toolbar" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/emergencytoolbar"
android:scrollbars="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/app_name"
android:textSize="18dp" />
<TextView
android:id="#+id/primname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="Ajith Kumar"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View01"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#FFFFFF" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/app_name"
android:textSize="18dp" />
<TextView
android:id="#+id/primrelationship"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="Brother"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View02"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#FFFFFF" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="phone"
android:textSize="18dp" />
<TextView
android:id="#+id/primphone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="9998885231"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View03"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#FFFFFF" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/app_name"
android:textSize="18dp" />
<TextView
android:id="#+id/primaddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="78,Muthu nagar 3rd Street,Coimbatore-44"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View04"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#FFFFFF" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
Try this, I tried to add data to it and then scrolled. The views below toolbar are being scrolled as expected:
<?xml version="1.0" encoding="utf-8"?>
<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"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="in.net.codestar.ratingbar.MainActivity"
tools:showIn="#layout/activity_main">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/White"
android:orientation="vertical" >
<include
android:id="#+id/emergencytoolbar"
layout="#layout/emergency_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/name"
android:textSize="18dp" />
<TextView
android:id="#+id/primname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="Ajith Kumar"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View01"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/Hrmbg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/relationship"
android:textSize="18dp" />
<TextView
android:id="#+id/primrelationship"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="Brother"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View02"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/Hrmbg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/phone"
android:textSize="18dp" />
<TextView
android:id="#+id/primphone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="9998885231"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View03"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/Hrmbg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/taddress"
android:textSize="18dp" />
<TextView
android:id="#+id/primaddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="78,Muthu nagar 3rd Street,Coimbatore-4478,Muthu nagar 3rd Street,Coimbatore-44"
android:textSize="18dp" />
</LinearLayout>
<View
android:id="#+id/View04"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/Hrmbg" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</RelativeLayout>
emergency_toobar.xml :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:textColor="#color/Black"
android:weightSum="2"
>
<Button
android:id="#+id/pemergency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:clickable="#color/Hrmbg"
android:layout_weight="1"
android:textSize="18dp"
android:text="#string/pemergency"
android:textColor="#color/Black" />
<Button
android:id="#+id/semergency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:clickable="#color/Hrmbg"
android:layout_weight="1"
android:textSize="18dp"
android:text="#string/semergency"
android:textColor="#color/Black" />
</LinearLayout>
</RelativeLayout>
The following two lines solved my problem:
android:lines="4"
android:maxLines="4"
now it's working.
Related
I am trying to set my list view when I click on image, it should be hidden or shown but the problem is that when I inflate my list view in my activity, it is hiding behind and not taking complete space. When I perform on click event it opens behind the parent layout.
SNAPSHOT
<?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:id="#+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical"
tools:context="com.bitblue.dextronewproject.Avtivity.ReportActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/main_linear_layout">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="Fees History"
android:textSize="20sp"
android:typeface="monospace" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="5dp"
android:background="#color/studentlogin" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Receipt"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Amount"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Date"
android:typeface="monospace" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_2"
android:layout_below="#+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TableLayout
android:id="#+id/r_tablelayoutRAD"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
</TableLayout>
<ImageView
android:id="#+id/drop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5.5"
android:src="#drawable/ic_drop_down_round_button" />
</LinearLayout>
<ListView
android:layout_below="#id/ll_2"
android:id="#+id/lisstview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
</ListView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Unpaid"
android:textSize="20sp"
android:typeface="monospace" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="30dp"
android:text="Type"
android:textSize="15dp"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="30dp"
android:text="Amount"
android:textSize="15dp"
android:typeface="monospace" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="5dp"
android:background="#color/studentlogin" />
<ListView
android:layout_width="match_parent"
android:id="#+id/un_paid_list_view"
android:layout_height="wrap_content">
</ListView>
</LinearLayout>
</RelativeLayout>
Your effort is appreciable.Thanks in andvance
Your parent layouts are not matching. You have used layout_below in LinearlLayout where the parent is not RelativeLayout. Check the hierarchy of the layouts in your layout.
Try this:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical"
tools:context="com.bitblue.dextronewproject.Avtivity.ReportActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Fees History"
android:textSize="20sp"
android:typeface="monospace"
android:id="#+id/textView1"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="5dp"
android:background="#color/studentlogin"
android:layout_below="#+id/textView1"
android:id="#+id/view1"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="#+id/view1"
android:id="#+id/ll1">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Receipt"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Amount"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Date"
android:typeface="monospace" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_2"
android:layout_below="#+id/ll1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TableLayout
android:id="#+id/r_tablelayoutRAD"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
</TableLayout>
<ImageView
android:id="#+id/drop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5.5"
android:src="#drawable/ic_drop_down_round_button" />
</LinearLayout>
<ListView
android:layout_below="#+id/ll_2"
android:id="#+id/lisstview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Unpaid"
android:textSize="20sp"
android:typeface="monospace"
android:layout_below="#+id/lisstview"
android:id="#+id/textView2"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="#+id/textView2"
android:id="#+id/ll3">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="30dp"
android:text="Type"
android:textSize="15dp"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="30dp"
android:text="Amount"
android:textSize="15dp"
android:typeface="monospace" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="5dp"
android:background="#color/studentlogin"
android:layout_below="#+id/ll3"
android:id="#+id/view3"/>
<ListView
android:layout_width="match_parent"
android:id="#+id/un_paid_list_view"
android:layout_height="wrap_content"
android:layout_below="#+id/ll3"/>
I am unable to place a layout at the bottom after a scroll view. Please help.
This is my code:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="fill_parent" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp">
<android.support.v7.widget.RecyclerView
android:id="#+id/my_recycler_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fadingEdgeLength="0dp"
android:overScrollMode="never"
android:scrollbars="horizontal" />
<LinearLayout
android:id="#+id/bottom"
android:layout_width="match_parent"
android:layout_height="30dp"
android:orientation="horizontal"
android:gravity="bottom">
<LinearLayout
android:id="#+id/linear_call"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:orientation="vertical"
android:gravity="center"
android:padding="8dp"
android:background="#drawable/list_selector">
<ImageView
android:id="#+id/btn_phone_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/call_us_tab"/>
<TextView
android:id="#+id/call"
android:textColor="#android:color/white"
android:text="Call Us"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#5488B8" />
<LinearLayout
android:id="#+id/linear_message"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:orientation="vertical"
android:gravity="center"
android:padding="8dp"
android:background="#drawable/list_selector"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/message_tab"
/>
<TextView
android:id="#+id/msg"
android:textColor="#android:color/white"
android:text="Message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#5488B8" />
<LinearLayout
android:id="#+id/linear_share"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:orientation="vertical"
android:gravity="center"
android:background="#drawable/list_selector"
android:padding="8dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/share_tab"/>
<TextView
android:id="#+id/share"
android:textColor="#android:color/white"
android:text="Share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fadingEdgeLength="0dp"
android:padding="5dp"
android:fillViewport="true"
android:overScrollMode="never"
android:scrollbars="none"
android:layout_above="#+id/bottom">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="#+id/tv_name_detail_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textStyle="bold"
android:layout_marginTop="5dp"/>
<TextView
android:id="#+id/tv_map"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Show Map"
android:singleLine="true"
android:textStyle="bold"
android:layout_marginTop="5dp"/>
</RelativeLayout>
<TextView
android:id="#+id/tv_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<RatingBar
android:layout_marginTop="2dp"
android:id="#+id/rating_bar_pro_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
style="#style/foodRatingBar"/>
<TextView
android:id="#+id/tv_nearby"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp" />
<TextView
android:layout_marginTop="5dp"
android:id="#+id/tv_specialization"
android:text="Specialization: "
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<ListView
android:id="#+id/list_specialization"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textStyle="bold"
android:layout_marginTop="5dp"
android:id="#+id/tv_education"
android:text="Education:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ListView
android:id="#+id/list_education"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textStyle="bold"
android:id="#+id/tv_experiences"
android:layout_marginTop="5dp"
android:text="Experiences:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ListView
android:id="#+id/list_experience"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
<!-- The navigation drawer -->
<ListView android:id="#+id/left_drawer"
android:layout_width="260dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="#5488B8"
android:dividerHeight="1dp"
android:background="#00427F"
android:listSelector="#drawable/list_selector"
/>
</android.support.v4.widget.DrawerLayout>
Try like this, this will fix your problem.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.RecyclerView
android:id="#+id/my_recycler_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:fadingEdgeLength="0dp"
android:overScrollMode="never"
android:scrollbars="horizontal" />
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/bottom"
android:layout_below="#+id/my_recycler_view"
android:fadingEdgeLength="0dp"
android:fillViewport="true"
android:overScrollMode="never"
android:padding="5dp"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="#+id/bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="bottom"
android:orientation="horizontal">
</LinearLayout>
</RelativeLayout>
Use root layout as RelativeLayout and the view you want to align bottom that's add this line:
android:layout_alignParentBottom="true"
This will solve your issue.
Try this and give your scroll view any variable size rather than wrap_content
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="#+id/my_recycler_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fadingEdgeLength="0dp"
android:overScrollMode="never"
android:scrollbars="horizontal" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fadingEdgeLength="0dp"
android:padding="5dp"
android:fillViewport="true"
android:overScrollMode="never"
android:scrollbars="none"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/tv_name_detail_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textStyle="bold"
android:layout_marginTop="5dp"
/>
<TextView
android:id="#+id/tv_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<RatingBar
android:layout_marginTop="2dp"
android:id="#+id/rating_bar_pro_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
style="#style/foodRatingBar"
/>
<TextView
android:id="#+id/tv_nearby"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
/>
<TextView
android:layout_marginTop="5dp"
android:id="#+id/tv_specialization"
android:text="Specialization: "
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<ListView
android:layout_marginTop="5dp"
android:id="#+id/list_specialization"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textStyle="bold"
android:layout_marginTop="5dp"
android:id="#+id/tv_education"
android:text="Education:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ListView
android:layout_marginTop="5dp"
android:id="#+id/list_education"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textStyle="bold"
android:id="#+id/tv_experiences"
android:layout_marginTop="5dp"
android:text="Experiences:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ListView
android:layout_marginTop="5dp"
android:id="#+id/list_experience"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="#+id/bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="bottom"
>
<LinearLayout
android:id="#+id/linear_call"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:orientation="vertical"
android:gravity="center"
android:padding="8dp"
android:background="#drawable/list_selector">
<ImageView
android:id="#+id/btn_phone_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/call_us_tab"/>
<TextView
android:id="#+id/call"
android:textColor="#android:color/white"
android:text="Call Us"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#5488B8" />
<LinearLayout
android:id="#+id/linear_message"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:orientation="vertical"
android:gravity="center"
android:padding="8dp"
android:background="#drawable/list_selector"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/message_tab"
/>
<TextView
android:id="#+id/msg"
android:textColor="#android:color/white"
android:text="Message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#5488B8" />
<LinearLayout
android:id="#+id/linear_share"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:orientation="vertical"
android:gravity="center"
android:background="#drawable/list_selector"
android:padding="8dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/share_tab"/>
<TextView
android:id="#+id/share"
android:textColor="#android:color/white"
android:text="Share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
You need to use RelativeLayout instead of LinearLayout at parent and then you can place items up and down to each other like
which view you want below to another view you can use this
android:layout_below="#+id/yourview"
and for view you want above to other you can use this
android:layout_above="#+id/yourview"
here is a sample
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/main"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView">
<!-- some stuff in here -->
</LinearLayout>
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
Hope it helps
try this hopefully this is what you wanted
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="#+id/my_recycler_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fadingEdgeLength="0dp"
android:overScrollMode="never"
android:scrollbars="horizontal"
/>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="220dp"
android:fadingEdgeLength="0dp"
android:padding="5dp"
android:fillViewport="true"
android:overScrollMode="never"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/tv_name_detail_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textStyle="bold"
android:layout_marginTop="5dp"
android:text="Name"/>
<TextView
android:id="#+id/tv_address"
android:text="address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<RatingBar
android:layout_marginTop="2dp"
android:id="#+id/rating_bar_pro_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
/>
<TextView
android:id="#+id/tv_nearby"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
/>
<TextView
android:layout_marginTop="5dp"
android:id="#+id/tv_specialization"
android:text="Specialization: "
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<ListView
android:layout_marginTop="5dp"
android:id="#+id/list_specialization"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textStyle="bold"
android:layout_marginTop="5dp"
android:id="#+id/tv_education"
android:text="Education:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ListView
android:layout_marginTop="5dp"
android:id="#+id/list_education"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textStyle="bold"
android:id="#+id/tv_experiences"
android:layout_marginTop="5dp"
android:text="Experiences:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ListView
android:layout_marginTop="5dp"
android:id="#+id/list_experience"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="5"
>
<LinearLayout
android:layout_weight="2"
android:id="#+id/bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="bottom"
android:weightSum="3"
>
<LinearLayout
android:id="#+id/linear_call"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center"
android:weightSum="3"
android:background="#000000">
<ImageView
android:id="#+id/btn_phone_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/name_top"
android:layout_weight="2"
/>
<TextView
android:id="#+id/call"
android:textColor="#android:color/white"
android:text="Call Us"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#5488B8" />
<LinearLayout
android:id="#+id/linear_message"
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:weightSum="2"
android:layout_weight="1"
android:background="#000000"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/name_top"
android:layout_weight="1"
/>
<TextView
android:id="#+id/msg"
android:textColor="#android:color/white"
android:text="Message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#5488B8" />
<LinearLayout
android:id="#+id/linear_share"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center"
android:background="#000000"
android:weightSum="2"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/name_top"
android:layout_weight="1"
/>
<TextView
android:id="#+id/share"
android:textColor="#android:color/white"
android:text="Share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</LinearLayout>
</LinearLayout>
<!-- The navigation drawer -->
<ListView
android:layout_weight="3"
android:id="#+id/left_drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="#5488B8"
android:dividerHeight="1dp"
android:background="#00427F"
android:listSelector="#898989"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Please update version of a recyclerview library in gradle file :
compile 'com.android.support:recyclerview-v7:23.2.1'
It should solve your issue.
Due to this issue, wrap_content not used to work on recyclerview before this version.
I am trying to make a layout in which there are two main layouts.
One is an imageview and the second one is a scrollview. What I want is that the imageview is always kept on top of the scrollview. When I run the program the image goes back to the scrollview.
<?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:background="#android:color/white"
android:orientation="vertical" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/img_back"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="left|top"
android:layout_margin="10dp"
android:background="#android:color/black"
android:contentDescription="#null"
android:src="#drawable/back" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:scrollbars="none" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<!-- Top linear layout -->
<LinearLayout
android:id="#+id/ll_above_map"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="250dp" >
<com.shotwell.customviews.SmartViewPager
android:id="#+id/vp_slider"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.viewpagerindicator.CirclePageIndicator
android:id="#+id/dots"
android:layout_width="match_parent"
android:layout_height="10dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp" />
<!--
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="#null"
android:scaleType="centerCrop"
android:src="#drawable/bigimage" /
-->
>
<TextView
android:id="#+id/tv_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:text="Pan-Asian"
android:textColor="#android:color/white"
android:textSize="18sp"
android:textStyle="normal" />
<TextView
android:id="#+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#id/tv_subtitle"
android:layout_alignLeft="#id/tv_subtitle"
android:text="Oka"
android:textColor="#android:color/white"
android:textSize="25sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#id/tv_subtitle"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/tv_subtitle"
android:background="#drawable/open_btn"
android:focusable="false"
android:gravity="center"
android:text="Open"
android:textColor="#android:color/white" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#878787" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:text="56"
android:textColor="#android:color/black"
android:visibility="gone" />
<RatingBar
android:id="#+id/rb_rating"
style="#style/StarRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:rating="5.0" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical" >
<TextView
android:id="#+id/tv_desc_toggle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Description"
android:textColor="#6A6A6A"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/dummy_list_text"
android:textColor="#color/dark_gray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray" >
</LinearLayout>
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:id="#+id/rl_map_holder"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_margin="10dp" >
<com.google.android.gms.maps.MapView
android:id="#+id/mapview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:id="#+id/tv_full_map"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="FullScreen"
android:textColor="#android:color/black"
android:textStyle="bold" />
</RelativeLayout>
<!-- bottom layout -->
<LinearLayout
android:id="#+id/ll_below_map"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:orientation="vertical" >
<TextView
android:id="#+id/tv_address_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="1dp"
android:text="Berlin Top, Fiapre Suryani"
android:textColor="#android:color/black"
android:textSize="12sp" />
<TextView
android:id="#+id/tv_state_country"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="1dp"
android:text="Brong Afoo, Ghana"
android:textColor="#android:color/black"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Phone no: "
android:textColor="#android:color/black"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" 024133556677"
android:textColor="#android:color/black"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Email: "
android:textColor="#android:color/black"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="abc#yahoo.com"
android:textColor="#android:color/black"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="URL: "
android:textColor="#android:color/black"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_url"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="www.newstate.com"
android:textColor="#android:color/black"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/ll_container_facility"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical" >
<TextView
android:id="#+id/tv_toggle_facilities"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Facilities"
android:textColor="#6A6A6A"
android:textSize="22sp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/ll_facilities"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<!--
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/dummy_list_text"
android:textColor="#color/dark_gray" />
-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray" >
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/ll_container_hours"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical" >
<TextView
android:id="#+id/tv_toggle_timing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hours"
android:textColor="#6A6A6A"
android:textSize="22sp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/ll_timings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="0dp"
android:background="#android:color/darker_gray" >
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</FrameLayout>
</LinearLayout>
It's the code of activity. which I am using. Resultant screen looks like this.
So in layouts it shows lines where I place my imageview but it won't show up.
I think maybe the scrollview is pushing back the imageview.
So how to put my imageview on top of the scrollview ?
I have a viewpager with 5 fragments and one among them is a search fragment with a google map the weired issue is that in some device the map is displayed with no problem but in some device(micromax aq 5000 Kitkat) it's not getting displayed
fragment
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/mainlayerr"
android:orientation="vertical" >
<ScrollView
android:layout_height="wrap_content"
android:layout_width="match_parent"
>
<LinearLayout
android:id="#+id/ll_MenuLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<AutoCompleteTextView
android:id="#+id/txtSearchh"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_marginLeft="#dimen/space_2_5_x"
android:layout_marginRight="#dimen/space_2_5_x"
android:layout_marginTop="#dimen/space_2_5_x"
android:hint="Search"
android:layout_gravity="bottom|left"
android:padding="5dp"
android:background="#null"
android:textColor="#color/markerboxcolor"
/>
<View
android:layout_height="1dp"
android:layout_marginTop="-6dp"
android:layout_width="match_parent"
android:layout_marginLeft="#dimen/space_2_5_x"
android:layout_marginRight="#dimen/space_2_5_x"
android:background="#color/divider_color"
/>
<RelativeLayout
android:id="#+id/search_menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="horizontal" >
<LinearLayout
android:id="#+id/tab2_wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="#dimen/space_0_x"
android:layout_centerInParent="true"
android:orientation="horizontal"
android:padding="#dimen/space_2_x" >
<CheckBox
android:id="#+id/checkimage_male"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:contentDescription="#string/app_name"
android:text="Male"
android:layout_marginRight="5dp"
android:gravity="center|center_vertical|center_horizontal"
/>
<CheckBox
android:id="#+id/checkimage_female"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:text="Female"
android:layout_marginLeft="5dp"
android:contentDescription="#string/app_name"
android:gravity="center|center_vertical|center_horizontal"
/>
</LinearLayout>
</RelativeLayout>
<HorizontalScrollView
android:orientation="horizontal" android:layout_width="wrap_content"
android:id="#+id/horizontalScrolll"
android:layout_margin="10dp"
android:scrollbars="none"
android:background="#C6D7D2" android:layout_height="80dp">
<LinearLayout android:id="#+id/container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
</LinearLayout>
</HorizontalScrollView>
<LinearLayout
android:id="#+id/distance_menu"
android:layout_width="match_parent"
android:layout_height="#dimen/footer_tabs_container_height"
android:layout_below="#+id/sportsViewPager"
android:baselineAligned="false"
android:gravity="center_vertical"
android:orientation="horizontal" >
<LinearLayout
android:id="#+id/tab3_wrapper"
android:layout_width="0dip"
android:layout_height="#dimen/container_height"
android:layout_gravity="center|center_horizontal|center_vertical"
android:layout_marginRight="#dimen/space_2_x"
android:layout_weight="0.15"
android:orientation="vertical" >
<TextView
android:id="#+id/distance"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="#dimen/space_2_x"
android:gravity="left|center_horizontal|center_vertical"
android:paddingLeft="#dimen/space_2_x"
android:text="#string/search_dist"
android:textColor="#color/text_color1x"
android:textSize="#dimen/text_size_medium"
android:textStyle="normal" />
</LinearLayout>
<LinearLayout
android:id="#+id/tab4_wrapper"
android:layout_width="0dip"
android:layout_height="#dimen/footer_tabs_container_height"
android:layout_marginRight="#dimen/space_2_x"
android:layout_weight=".5"
android:gravity="center_vertical"
android:orientation="horizontal" >
<com.sportspartners.sportspartners.util.DiscreteSeekBar
android:id="#+id/seekBarr"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="#dimen/space_2_x"
android:paddingRight="#dimen/space_2_x"
app:dsb_allowTrackClickToDrag="false"
app:dsb_indicatorTextAppearance="#style/CustomFloaterTextAppearance"
app:dsb_progressColor="#color/my_progress_color"
app:dsb_rippleColor="#FF7788FF"
app:dsb_indicatorColor="#color/my_floater_color"
app:dsb_indicatorFormatter="%d" />
<TextView
android:id="#+id/progressID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/space_2_x"
android:layout_marginRight="#dimen/space_2_x"
android:text="10 Kms" >
</TextView>
</LinearLayout>
</LinearLayout>
<View
android:id="#+id/seprater1"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#+id/from_menu"
android:background="#color/blue" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:layout_below="#+id/seprater1"
>
<fragment
android:id="#+id/mappy"
android:layout_width="match_parent"
android:layout_height="400dp"
android:name="com.sportspartners.sportspartners.fragments.search.SearchFragment"
class="com.google.android.gms.maps.MapFragment" />
<View
android:id="#+id/imageView123"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#android:color/transparent" />
</FrameLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
<ListView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_margin="5dp"
android:divider="#null"
android:scrollbars="none"
android:id="#+id/searchhList"
android:visibility="gone"
></ListView>
<ImageView
android:id="#+id/progress_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="gone"
/>
<LinearLayout
android:layout_width="80dp"
android:layout_height="wrap_content"
android:id="#+id/messagenotificationlayout"
android:layout_alignParentRight="true"
android:visibility="gone"
android:layout_alignBottom="#+id/searchhList"
android:descendantFocusability="blocksDescendants"
>
<com.example.floatinglibrary.FloatingActionButton
android:clickable="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/chatterimage"
app:fab_addButtonColorNormal="#00000000"
android:id="#+id/messagenotificationbtn"
android:background="#null"
app:fab_size="normal"
/>
<TextView
android:background="#drawable/blue_circle"
android:id="#+id/messagenotificationbadge"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:paddingRight="5dp"
android:layout_marginLeft="-17dp"
android:layout_marginTop="-20dp"
android:paddingBottom="5dp"
android:layout_height="wrap_content"
android:padding="2sp"
android:clickable="false"
android:text="10"
android:textColor="#color/white"
android:textSize="#dimen/text_size_micro_min"
/>
</LinearLayout>
</RelativeLayout>
parent layout with view pager
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/titlecontainer"
>
<LinearLayout
android:id="#+id/titlbarrSearch"
android:layout_width="match_parent"
android:layout_height="55dp"
android:background="#color/markerboxcolor"
android:layout_gravity="top"
android:orientation="horizontal"
android:paddingTop="4dp"
android:visibility="gone"
android:gravity="center_vertical"
>
<ImageButton
android:layout_marginLeft="3dp"
android:id="#+id/btnsearchback"
android:src="#drawable/searchback"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_width="wrap_content"
android:background="#null"
/>
<TextView
android:id="#+id/txttitle"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:gravity="center_horizontal"
android:layout_gravity="center"
android:text="Search"
android:textColor="#color/pure_white"
android:textSize="#dimen/text_size_large"
/>
</LinearLayout>
<LinearLayout
android:id="#+id/titlbarr"
android:layout_width="match_parent"
android:layout_height="55dp"
android:background="#color/markerboxcolor"
android:layout_gravity="top"
android:weightSum="5"
android:gravity="center"
>
<RelativeLayout
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
>
<TextView
android:id="#+id/txt1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="Feed"
android:gravity="center"
android:textColor="#color/tabred"
/>
<View
android:layout_height="4dp"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:background="#color/tabred"
android:id="#+id/view1"
/>
</RelativeLayout>
<RelativeLayout
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
>
<TextView
android:id="#+id/txt2"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="Profile"
android:gravity="center"
android:textColor="#ffffff"
/>
<View
android:layout_height="4dp"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:background="#color/pure_white"
android:id="#+id/view2"
android:visibility="gone"
/>
</RelativeLayout>
<RelativeLayout
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
>
<TextView
android:id="#+id/txt3"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="Search"
android:gravity="center"
android:textColor="#ffffff"
/>
<View
android:layout_height="4dp"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:background="#color/pure_white"
android:id="#+id/view3"
android:visibility="gone"
/>
</RelativeLayout>
<RelativeLayout
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
>
<TextView
android:id="#+id/txt4"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="Followers"
android:gravity="center"
android:textColor="#ffffff"
/>
<View
android:layout_height="4dp"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:background="#color/pure_white"
android:id="#+id/view4"
android:visibility="gone"
/>
</RelativeLayout>
<RelativeLayout
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
>
<TextView
android:id="#+id/txt5"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="Settings"
android:gravity="center"
android:textColor="#ffffff"
/>
<View
android:layout_height="4dp"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:background="#color/pure_white"
android:id="#+id/view5"
android:visibility="gone"
/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
<com.sportspartners.sportspartners.util.MyViewpager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_below="#+id/titlecontainer"
android:layout_height="match_parent" >
<android.support.v4.view.PagerTabStrip
android:id="#+id/pager_headerr"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/markerboxcolor"
android:layout_gravity="top"
android:visibility="gone"
android:paddingBottom="4dp"
android:paddingTop="4dp"
android:textColor="#ffffff" />
</com.sportspartners.sportspartners.util.MyViewpager>
</RelativeLayout>
Finally I got the answer google map will not show up(in some devices) if it's placed inside a scroll view for that I need to set android:fillViewport="true" inside scroll view this may stop scrolling the map but will show it to a perfect size
I am having a screen which has many layouts having title,list view ,comment and buttons but buttons are not getting displayed at all,after list view display I am getting a huge amount of empty space after which comment is getting displayed and buttons are not seen ,this is my code.
<?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"
android:background="#android:color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:layout_margin="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="12345617890" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:fontFamily="#android:color/black"
android:text="Ramakrisha Tripati" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="9876543210" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_margin="10dp"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="13/1/2015" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="Rohit Sharma" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="55dp"
android:orientation="horizontal"
android:background="#android:color/holo_orange_light">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="item#\nstyle#"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="M Wt\nD Wt\nCS Wt"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Making\nD Rate\nCS Rate"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Margin\nDis %\nDiscount"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GT\nFSP"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView android:id="#+id/listView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:divider="#00000000"
android:dividerHeight="5dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dp"
android:text="Comment" />
<EditText
android:id="#+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:ems="10"
android:hint="Comment goes here"
android:inputType="textMultiLine" />
</LinearLayout>
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="accept"
android:src="#drawable/accept"
/>
</LinearLayout>
I have modified your layout code and now the button has appeared.
<?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:background="#android:color/white"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="12345617890" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:fontFamily="#android:color/black"
android:text="Ramakrisha Tripati" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="9876543210" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="13/1/2015" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="Rohit Sharma" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="55dp"
android:background="#android:color/holo_orange_light"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="item#\nstyle#" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="M Wt\nD Wt\nCS Wt" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Making\nD Rate\nCS Rate" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Margin\nDis %\nDiscount" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="GT\nFSP" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="#+id/listView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:divider="#00000000"
android:dividerHeight="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Comment"
android:textSize="25dp" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<EditText
android:id="#+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:ems="10"
android:hint="Comment goes here"
android:inputType="textMultiLine" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:onClick="accept"
android:src="#drawable/accept" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Just put your main LinearLayout inside scrollview and you will see thr buttons.
And if not so maybe your image is so small or transparent.
check with another image maybe.