Alignment issue when using different screen resolutions - android

please help me to arrange the layouts and elements which is suitable for all devices,
my current xml codes is given below.the main problem is the elements are changed when it runs on different screen resolutions`
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="2dp" >
<Button
android:id="#+id/firstimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/smallcircle"
android:gravity="center"
android:scaleType="fitXY" />
<ImageView
android:id="#+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/workscam"/>
<TextView
android:id="#+id/texthere"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="helloooo"
android:textSize="15dp"
android:layout_below="#+id/firstimage"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp" >
<ImageView
android:id="#+id/secondimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/smallcircle" />
<ImageView
android:id="#+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/workscam"
android:textSize="15dp" />
<TextView
android:id="#+id/texthere2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="helloooo"
android:textSize="15dp"
android:layout_below="#+id/secondimage"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp" >
<ImageView
android:id="#+id/thirdimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/smallcircle" />
<ImageView
android:id="#+id/text3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/workscam"
android:textSize="15dp" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/second_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/first_row"
android:layout_centerHorizontal="true"
android:layout_margin="15dp"
android:orientation="horizontal" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp" >
<ImageView
android:id="#+id/fourthimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/smallcircle" />
<ImageView
android:id="#+id/text4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/workscam"
android:textSize="15dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp" >
<ImageView
android:id="#+id/fifthimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/smallcircle" />
<ImageView
android:id="#+id/text5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/workscam"
android:textSize="15dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp" >
<ImageView
android:id="#+id/sixthimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/smallcircle" />
<ImageView
android:id="#+id/text6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/workscam"
android:textSize="15dp" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/third_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/second_row"
android:layout_centerHorizontal="true"
android:layout_margin="15dp"
android:orientation="horizontal" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp" >
<ImageView
android:id="#+id/sevimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/smallcircle" />
<ImageView
android:id="#+id/text7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/workscam"
android:textSize="15dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp" >
<ImageView
android:id="#+id/eighthimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/smallcircle" />
<ImageView
android:id="#+id/text8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/workscam"
android:textSize="15dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp" >
<ImageView
android:id="#+id/ninthimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/smallcircle" />
<ImageView
android:id="#+id/text9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/workscam"
android:textSize="15dp" />
</RelativeLayout>
</LinearLayout>
`

Related

Button Above linearlayout Android XML UI

I have this problem...
This is a screenshot of my XML File in Android Studio
this is the code...
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="#color/gris_300"
android:orientation="vertical">
<ImageView
android:id="#+id/imageView4"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:scaleType="fitXY"
android:src="#drawable/image" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_below="#+id/imageView4"
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_marginTop="-50dp">
<Button
android:id="#+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/selector_oval"
android:text="AGREGAR ITEMS"
android:textColor="#color/white"
android:layout_below="#+id/imageView4"
android:layout_centerHorizontal="true"
android:layout_above="#+id/linearLayout3"
android:padding="10dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp" />
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#color/white"
android:clickable="false"
android:orientation="vertical"
android:layout_marginTop="-20dp">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="#+id/ll_ver_pedido"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="50dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/carrito" />
<TextView
android:id="#+id/textView19"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu3"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_ver_estado"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_estado" />
<TextView
android:id="#+id/textView6"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu1"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_llamar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView26"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_llamar" />
<TextView
android:id="#+id/textView23"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu7"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_ver_mesa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_ver_mesa" />
<TextView
android:id="#+id/textView18"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu2"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pedido" />
<TextView
android:id="#+id/textView10"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Ver mi ticket"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_pagar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView24"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView22"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu6"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView43"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView46"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Mis rewards"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_uber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView42"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView42"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Llamar a un taxi/uber"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView44"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView54"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Regalar una gift card"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>
and this is a screnshot of my device...
I tried Framelayout...relative...
Help!
Thanks!
Final code
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="#color/gris_300"
android:orientation="vertical">
<ImageView
android:id="#+id/imageView4"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:scaleType="fitXY"
android:src="#drawable/image" />
<FrameLayout
android:layout_width="fill_parent"
android:layout_below="#+id/imageView4"
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_marginTop="-30dp">
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#color/white"
android:clickable="false"
android:orientation="vertical"
android:layout_marginTop="20dp">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="#+id/ll_ver_pedido"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="50dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/carrito" />
<TextView
android:id="#+id/textView19"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu3"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_ver_estado"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_estado" />
<TextView
android:id="#+id/textView6"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu1"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_llamar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView26"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_llamar" />
<TextView
android:id="#+id/textView23"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu7"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_ver_mesa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_ver_mesa" />
<TextView
android:id="#+id/textView18"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu2"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pedido" />
<TextView
android:id="#+id/textView10"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Ver mi ticket"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_pagar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView24"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView22"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu6"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView43"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView46"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Mis rewards"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_uber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView42"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView42"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Llamar a un taxi/uber"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView44"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView54"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Regalar una gift card"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
<Button
android:id="#+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/selector_oval"
android:text="AGREGAR ITEMS"
android:textColor="#color/white"
android:layout_below="#+id/imageView4"
android:layout_centerHorizontal="true"
android:layout_above="#+id/linearLayout3"
android:padding="10dp"
android:layout_gravity="center_horizontal" />
</FrameLayout>

issue in bus seat layout in android

i want to create bus ticket booking layout in my app . i created layout but seat arrangement not came proper. below is image . i just want to seat layout proper other element is proper
seat_selection_screen.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<include
android:id="#+id/header"
layout="#layout/common_header_with_sub_title" />
<RelativeLayout
android:id="#+id/busDeckSelectionLayout"
android:layout_width="fill_parent"
android:layout_height="45.0dip"
android:layout_below="#+id/header" >
<RelativeLayout
android:id="#+id/busDeckSelectionButtons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#ffeeeeee" >
<Button
android:id="#+id/lowerDeck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="#drawable/left_button"
android:text="#string/lower"
android:textColor="#color/black"
android:textSize="12.0sp" />
<Button
android:id="#+id/upperDeck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/lowerDeck"
android:background="#drawable/right_button"
android:text="#string/upper"
android:textColor="#color/black"
android:textSize="12.0sp" />
</RelativeLayout>
</RelativeLayout>
<View
android:id="#+id/busDeckSelectionMargin"
android:layout_width="fill_parent"
android:layout_height="1.0dip"
android:layout_below="#+id/busDeckSelectionLayout"
android:background="#ffdddddd" />
<RelativeLayout
android:id="#+id/seatSelectionHeader"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/busDeckSelectionMargin" >
<RelativeLayout
android:id="#+id/seatsLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="5.0dip"
android:layout_marginTop="5.0dip" >
<TextView
android:id="#+id/seatsSelectedText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="#string/seats_selected"
android:textColor="#color/black"
android:textSize="12.0sp" />
<TextView
android:id="#+id/seatsSelected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/seatsSelectedText"
android:layout_marginTop="10.0dip"
android:textColor="#color/black"
android:textSize="14.0sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/fareLayout"
android:layout_width="wrap_content"
android:layout_height="40.0dip"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/seatsLayout"
android:background="#layout/fare_seat_selection_background" >
<TextView
android:id="#+id/rsText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginBottom="10.0dip"
android:layout_marginLeft="5.0dip"
android:layout_marginTop="10.0dip"
android:text="#string/rupees"
android:textColor="#color/black"
android:textSize="18.0sp" />
<TextView
android:id="#+id/fare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginBottom="10.0dip"
android:layout_marginRight="5.0dip"
android:layout_marginTop="10.0dip"
android:textColor="#color/black"
android:textSize="18.0sp" />
</RelativeLayout>
</RelativeLayout>
<View
android:id="#+id/seatSelectionHeaderMargin"
android:layout_width="fill_parent"
android:layout_height="1.0dip"
android:layout_below="#+id/seatSelectionHeader"
android:background="#ffdddddd" />
<RelativeLayout
android:id="#+id/seatLayoutScroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/bottomBarSeatSelection"
android:layout_below="#+id/seatSelectionHeaderMargin"
android:background="#color/white" >
<RelativeLayout
android:id="#+id/scrollableLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="#+id/seatLegendLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5.0dip"
android:layout_marginTop="5.0dip" >
<RelativeLayout
android:id="#+id/availableImageLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true" >
<ImageView
android:id="#+id/availableImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="10.0dip"
android:rotation="90.0"
android:src="#drawable/seat_layout_tab_nor_avl" />
<TextView
android:id="#+id/availableText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="5.0dip"
android:layout_toRightOf="#+id/availableImage"
android:text="#string/available"
android:textSize="12.0sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/bookedImageLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/availableImageLayout" >
<ImageView
android:id="#+id/bookedImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10.0dip"
android:rotation="90.0"
android:src="#drawable/seat_layout_tab_nor_bkd" />
<TextView
android:id="#+id/bookedText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="5.0dip"
android:layout_toRightOf="#+id/bookedImage"
android:text="#string/booked"
android:textSize="12.0sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/selectedImageLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/bookedImageLayout" >
<ImageView
android:id="#+id/selectedImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10.0dip"
android:rotation="90.0"
android:src="#drawable/seat_layout_tab_nor_std" />
<TextView
android:id="#+id/selectedText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="5.0dip"
android:layout_toRightOf="#+id/selectedImage"
android:text="#string/selected"
android:textSize="12.0sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/ladiesImageLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/selectedImageLayout">
<ImageView
android:id="#+id/ladiesImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10.0dip"
android:rotation="90.0"
android:src="#drawable/seat_layout_tab_nor_lad_avl" />
<TextView
android:id="#+id/ladiesText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="5.0dip"
android:layout_toRightOf="#+id/ladiesImage"
android:text="#string/ladies"
android:textSize="12.0sp" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="#+id/seatLayoutLowerMain"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_below="#+id/seatLegendLayout"
android:layout_centerHorizontal="true"
android:layout_marginTop="10.0dip"
android:background="#layout/seat_layout_border"
android:paddingBottom="5.0dp"
android:paddingRight="5.0dp" >
<GridView
android:id="#+id/gridView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="#+id/driver"
android:layout_margin="4dp"
android:columnWidth="100dp"
android:gravity="center"
android:numColumns="4"
android:stretchMode="columnWidth" >
</GridView>
<RelativeLayout
android:id="#+id/driver"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignRight="#+id/gridView1"
android:layout_marginRight="20.0dp"
android:layout_marginTop="5.0dp"
android:background="#drawable/steering_icon"
android:orientation="horizontal" >
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="#+id/seatLayoutUpper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/seatLegendLayout"
android:layout_centerHorizontal="true"
android:layout_marginTop="10.0dip"
android:background="#layout/seat_layout_border"
android:visibility="invisible" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="#+id/bottomBarSeatSelection"
android:layout_width="fill_parent"
android:layout_height="49.0dip"
android:layout_alignParentBottom="true"
android:background="#color/white" >
<Button
android:id="#+id/doneButton"
android:layout_width="160.0dip"
android:layout_height="48.0dip"
android:layout_alignParentLeft="true"
android:layout_marginTop="1.0dip"
android:background="#drawable/selector_red_btn"
android:text="#string/done"
android:textColor="#color/white"
android:textSize="18.0sp" />
<Button
android:id="#+id/cancelButton"
android:layout_width="160.0dip"
android:layout_height="48.0dip"
android:layout_alignParentRight="true"
android:layout_marginTop="1.0dip"
android:background="#drawable/selector_black_btn"
android:text="#string/goBack"
android:textColor="#color/white"
android:textSize="18.0sp" />
</RelativeLayout>
</RelativeLayout>

Resize image background keyboard(android)

Sorry for my english. I have background image, if keyboard show is resize background image. If keyboard not show evrithing work fine.
sorry obout image i have not 15 reputation
Its normal condition: image
Its if keyboard is show: image, background image is resize
Its if i in manifest i write adjustPan image
Bellow my xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:background="#9a5f35"
android:layout_height="50dp" >
<LinearLayout
android:id="#+id/edit_profile"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
</LinearLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:text="Получить бонус"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20sp" />
<RelativeLayout
android:id="#+id/backDd"
android:layout_width="100dp"
android:layout_height="50dp" >
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:src="#drawable/back_arraund" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom" >
<ScrollView
android:id="#+id/scroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:fadingEdge="none" >
<ImageView
android:id="#+id/imageView21"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="#drawable/bg_shkaf" />
</ScrollView>
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="40dp"
android:orientation="vertical" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="1) Введите сумму вашего счета"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20dp" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="2) Сгенерируйте код"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20dp" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="3) Покажите код официанту"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20dp" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="4) Получите бонус на счет"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20dp" />
</LinearLayout>
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:gravity="center"
android:lineSpacingMultiplier="1.2"
android:text="Бонусы дают привликательную возможность\nполучть скидки и обменивать их на подарки\nот нашего кафе.Получайте как можно больше\nбонусов, для более ценных подарков"
android:textColor="#d2d3ce"
android:textSize="13dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="80dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="5dp"
android:text="Введите сумму:"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20dp" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1" >
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginRight="10dp"
android:background="#drawable/button_radius_get_bonus"
android:gravity="center_vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<EditText
android:id="#+id/summgrn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:hint="1200"
android:inputType="number"
android:maxLines="1"
android:maxLength="5"
android:background="#null"
android:textColor="#fff"
android:textColorHint="#91623f" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:layout_marginRight="20dp"
android:layout_weight="1"
android:text="грн."
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20dp" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:layout_marginTop="1dp"
android:text="и покажите официанту код"
android:textColor="#fff"
/>
<ImageView
android:id="#+id/registrationsdasdad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="1dp"
android:layout_marginTop="1dp"
android:src="#drawable/review_button"
android:visibility="invisible" />
<TextView
android:id="#+id/textView102"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="50dp"
android:layout_marginTop="1dp"
android:text="Мы очень старались - оцените нас!"
android:textColor="#fff"
android:visibility="invisible" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
<ImageView
android:id="#+id/imageView212"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_centerHorizontal="true"
android:scaleType="centerCrop"
android:layout_marginTop="10dp"
android:visibility="invisible"
android:src="#drawable/image_8" />
<RelativeLayout
android:id="#+id/generateBonus"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="bottom"
android:background="#9a5f35"
android:gravity="center_horizontal"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<TextView
android:id="#+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Получить"
android:textColor="#fff"
android:textSize="20dp" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>

Listview with edittext inside scrollview is not clickable

I have a listview with edittext as row items inside scrollview.I have used on touch listener on listview so I can scroll the list inside scrollview.But unable to make a call to onItemClickListener or OnItemSelectedListener.
I have tried android:windowSoftInputMode="adjustPan".
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/rlHamburger"
android:layout_width="50dp"
android:layout_height="match_parent" >
<Button
android:id="#+id/btnHamburger"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_centerInParent="true"
android:background="#drawable/images" />
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="#+id/rlHamburger" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/rlTitle"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="5dp"
android:background="#drawable/relative_background" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_margin="10dp"
android:text="Add Quote"
android:textColor="#color/black"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlButtons"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="#id/rlTitle"
android:layout_margin="5dp"
android:orientation="horizontal" >
<Button
android:id="#+id/btnBack"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="#drawable/button"
android:gravity="center"
android:text="Back"
android:textColor="#drawable/text_color" />
<Button
android:id="#+id/btnAddPhoto"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:layout_toLeftOf="#+id/btnAddNote"
android:layout_weight="1"
android:background="#drawable/button"
android:gravity="center"
android:text="Add Photo"
android:textColor="#drawable/text_color" />
<Button
android:id="#+id/btnAddNote"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:layout_toLeftOf="#+id/btnSave"
android:layout_weight="1"
android:background="#drawable/button"
android:gravity="center"
android:text="Add Note"
android:textColor="#drawable/text_color" />
<Button
android:id="#+id/btnSave"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:background="#drawable/button"
android:gravity="center"
android:text="Save"
android:textColor="#drawable/text_color" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlInformation"
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_below="#id/rlButtons"
android:layout_margin="5dp"
android:background="#drawable/relative_background"
android:orientation="horizontal"
android:padding="5dp" >
<RelativeLayout
android:id="#+id/rlInfo1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp" >
<TextView
android:id="#+id/title"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Title" />
<EditText
android:id="#+id/tvTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/title"
android:background="#drawable/relative_background"
android:hint="Title"
android:padding="5dp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlInfo2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/rlInfo1"
android:layout_margin="2dp" >
<TextView
android:id="#+id/owner"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Owner" />
<EditText
android:id="#+id/tvOwner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/owner"
android:background="#drawable/relative_background"
android:hint="Owner"
android:padding="5dp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlInfo3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/rlInfo2"
android:layout_margin="2dp" >
<TextView
android:id="#+id/address"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Address" />
<EditText
android:id="#+id/tvAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/address"
android:background="#drawable/relative_background"
android:hint="Address"
android:padding="5dp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlInfo4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/rlInfo3"
android:layout_margin="2dp" >
<TextView
android:id="#+id/status"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Status" />
<TextView
android:id="#+id/tvStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#id/status"
android:text="Status" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlInfo5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/rlInfo4"
android:layout_margin="2dp" >
<TextView
android:id="#+id/description"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Description" />
<EditText
android:id="#+id/tvDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/description"
android:background="#drawable/relative_background"
android:hint="Description"
android:padding="5dp" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/rlInformation"
android:layout_margin="10dp" >
<TextView
android:id="#+id/tvProductName"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Product Name" />
<TextView
android:id="#+id/tvShortDescription"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/tvProductName"
android:gravity="center"
android:text="Short Description" />
<TextView
android:id="#+id/tvQuantity"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/tvShortDescription"
android:gravity="center"
android:text="Qty" />
<TextView
android:id="#+id/tvUnits"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/tvQuantity"
android:gravity="center"
android:text="units" />
<TextView
android:id="#+id/tvPrice"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/tvUnits"
android:gravity="center"
android:text="Price" />
<TextView
android:id="#+id/tvTotal"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="center"
android:text="Total" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlList1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/rlList"
android:layout_margin="10dp" >
<ListView
android:id="#+id/lvItems"
android:layout_width="match_parent"
android:layout_height="300dp" >
</ListView>
<Button
android:id="#+id/btnAddItem"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_below="#id/lvItems"
android:background="#drawable/button"
android:text="Add item"
android:textColor="#drawable/text_color" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/rlList1"
android:layout_margin="20dp" >
<TextView
android:id="#+id/tvTotalEstimation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="center"
android:text="Total estimation"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tvEstimationValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#id/tvTotalEstimation"
android:gravity="center"
android:text="$0.0"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
Here is the screenshot of my layout:
Please help me with the solution.Thanks.
Go to your manifest file and add these steps with activity tag of your class
android:configChanges="keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize|stateAlwaysHidden"

Can't resize a RelativeLayout inside a ScrollView to fill the whole screen

I am having a weird issue that I am not sure how to fix. I have a RelativeLayout inside a ScrollView and this scrollView has it's height set to fill_parent. So does the RelativeLayout. Still, the contents are not filling the entire screen and it's going only to the wrap_content of the last layout inside this RelativeLayout.
Here is my code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.pontai"
android:id="#+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/relativeLayout2"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/relativeLayout3"
android:layout_alignParentTop="true"
android:layout_alignRight="#+id/relativeLayout5"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="How much points you have here:"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="#+id/textViewTotalPoints1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="120"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<RelativeLayout
android:id="#+id/relativeLayout4"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:layout_alignLeft="#+id/relativeLayout3"
android:layout_below="#+id/linearLayout1"
android:layout_marginTop="5dp"
android:layout_toLeftOf="#+id/textView7"
android:orientation="vertical" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="Ratings"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textViewPositivePoints"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceSmall" />
<ImageView
android:id="#+id/imageView2"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_below="#+id/textView3"
android:layout_toLeftOf="#+id/textView3"
android:src="#drawable/thumbs_up_focused" />
<TextView
android:id="#+id/textViewNegativePoints"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/textView3"
android:layout_centerVertical="true"
android:layout_marginRight="3dp"
android:text="22"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textViewNegativePoints"
android:layout_alignBottom="#+id/textViewNegativePoints"
android:layout_alignLeft="#+id/textView3"
android:layout_marginLeft="3dp"
android:text="33"
android:textAppearance="?android:attr/textAppearanceSmall" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignTop="#+id/imageView2"
android:layout_toRightOf="#+id/textViewNegativePoints"
android:src="#drawable/thumbs_down_focused" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/relativeLayout5"
android:layout_width="95dp"
android:layout_height="80dp"
android:layout_alignRight="#+id/relativeLayout3"
android:layout_alignTop="#+id/relativeLayout4"
android:layout_toRightOf="#+id/textView7"
android:orientation="vertical" >
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="Comments"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:src="#drawable/speech_bubble" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/relativeLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/relativeLayout4"
android:layout_centerHorizontal="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp" >
<TextView
android:id="#+id/textViewOfferName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="Offer Name"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textViewBusinessName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="35dp"
android:text="Business Name"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textViewBusinessAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="60dp"
android:text="Business Address"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textViewNull1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="80dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textViewTotalPoints"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textViewNull1"
android:layout_centerHorizontal="true"
android:text="0/0"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="#+id/buttonUseNow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textViewTotalPoints"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="#string/offer_details_use_now" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/buttonUseNow"
android:layout_marginTop="10dp"
android:text="#string/_terms_and_conditions_"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="#+id/textViewTermsConditions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView2"
android:layout_marginTop="2dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/relativeLayout5"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp"
android:text="e"
android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="invisible" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
Anyone have ideas of how I can make the RelativeLayout2 to have the same height as the ScrollView, meaning, I want it to reach the bottom of the screen?
Thanks and regards,
Felipe
I have faced this problem before. Just Use android:fillViewport="true" in your scrollview and it will fill up the screen.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >

Categories

Resources