This is what I'm trying to achieve:
I'm trying to add an ImageView (cirlce avatar) which is aligned to the bottom right of the top bar but with an overlay extending below the bar.
Here's what I have so far:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="#ff652c90">
<ImageButton
android:layout_width="25dp"
android:layout_height="25dp"
android:id="#+id/backBtn"
android:src="#drawable/backarrow"
android:background="#android:color/transparent"
android:paddingLeft="10dp"
android:layout_centerVertical="true"
android:scaleType="fitCenter"
android:layout_gravity="center_vertical" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/backBtn"
android:id="#+id/infoLayout"
android:layout_centerVertical="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Lesky"
android:id="#+id/contactName"
android:textColor="#ffffffff"
android:paddingLeft="10dp"
android:textSize="16dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="last online 22/4/2016 11:36 am"
android:id="#+id/lastSeen"
android:layout_below="#id/contactName"
android:textColor="#ffd1d2d4"
android:paddingLeft="10dp"
android:textSize="10dp" />
</RelativeLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:id="#+id/imageView"
android:src="#drawable/contactpiccirlce"
android:scaleType="fitCenter" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/chatView"
android:layout_gravity="center_horizontal" />
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:background="#android:color/black"
android:layout_alignBottom="#id/chatView"
android:id="#+id/postArea">
<EditText
android:layout_width="wrap_content"
android:layout_height="30dp"
android:inputType="textMultiLine"
android:minHeight="30dp"
android:ems="10"
android:id="#+id/editText" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
How can anyone achieve this?
Replace with this
<?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" >
<RelativeLayout
android:id="#+id/firstLayout"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="#ff652c90" >
<ImageButton
android:id="#+id/backBtn"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:background="#android:color/transparent"
android:paddingLeft="10dp"
android:scaleType="fitCenter"
android:src="#drawable/backarrow" />
<RelativeLayout
android:id="#+id/infoLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#id/backBtn" >
<TextView
android:id="#+id/contactName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Lesky"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#ffffffff"
android:textSize="16dp" />
<TextView
android:id="#+id/lastSeen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/contactName"
android:paddingLeft="10dp"
android:text="last online 22/4/2016 11:36 am"
android:textColor="#ffd1d2d4"
android:textSize="10dp" />
</RelativeLayout>
</RelativeLayout>
<ImageView
android:id="#+id/imageView"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentRight="true"
android:layout_marginRight="5dp"
android:layout_marginTop="35dp"
android:scaleType="fitCenter"
android:src="#drawable/contactpiccirlce" />
<RelativeLayout
android:id="#+id/secondLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/firstLayout" >
<ListView
android:id="#+id/chatView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" />
<LinearLayout
android:id="#+id/postArea"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_alignBottom="#id/chatView"
android:background="#android:color/black"
android:orientation="vertical" >
<EditText
android:id="#+id/editText"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:ems="10"
android:inputType="textMultiLine"
android:minHeight="30dp" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
How about this:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/infoLayout">
<ImageButton
android:layout_width="25dp"
android:layout_height="25dp"
android:id="#+id/backBtn"
android:src="#drawable/backarrow"
android:background="#android:color/transparent"
android:paddingLeft="10dp"
android:layout_centerVertical="true"
android:scaleType="fitCenter"
android:layout_gravity="center_vertical" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/backBtn"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Lesky"
android:id="#+id/contactName"
android:textColor="#ffffffff"
android:paddingLeft="10dp"
android:textSize="16dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/backBtn"
android:text="last online 22/4/2016 11:36 am"
android:id="#+id/lastSeen"
android:layout_below="#id/contactName"
android:textColor="#ffd1d2d4"
android:paddingLeft="10dp"
android:textSize="10dp" />
</RelativeLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#id/infoLayout"
android:layout_alignTop="#id/infoLayout"
android:padding="10dp"
android:scaleType="center"
android:id="#+id/imageView"
android:src="#drawable/contactpiccirlce"
android:scaleType="fitCenter" />
Related
I want to achieve like the image below
And I tried, but it is not my desired result.
Below is my 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="wrap_content"
android:orientation="horizontal"
android:padding="5dip">
<LinearLayout android:id="#+id/thumbnail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:layout_alignParentLeft="true"
android:layout_marginRight="5dip">
<ImageView
android:id="#+id/photo"
android:layout_width="70dp"
android:layout_height="70dp"
android:scaleType="centerCrop"
android:layout_gravity="center"/>
</LinearLayout>
<TextView
android:id="#+id/ListDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/input_register"
android:text="Date"
android:layout_marginLeft="150dp"
android:layout_alignTop="#+id/thumbnail"
android:layout_toRightOf="#+id/thumbnail" />
<TextView
android:id="#+id/ListDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textSize="20sp"
android:text="Description"
android:ellipsize="end"
android:textStyle="bold"
android:layout_below="#id/ListDate"
android:layout_toRightOf="#+id/thumbnail" />
<TextView
android:id="#+id/ListAmount"
android:text="Amount"
android:layout_marginTop="40dp"
android:layout_marginLeft="166dp"
android:textSize="20sp"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:layout_toRightOf="#+id/thumbnail"
android:textColor="#color/violetred" />
</RelativeLayout>
How can I write the ... beside the Amount TextView same like the first image I post ? Any help is much appreciated.
You can have only one layout which will solve your problem nesting is not a good idea.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#mipmap/ic_launcher"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textColor="#000"
android:layout_gravity="center"
android:textSize="?android:actionBarItemBackground"
android:textStyle="bold"
android:text="8 hours # $80.00/hour"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:text="2014-05-08"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/activity_horizontal_margin"
android:textStyle="bold"
android:layout_gravity="end"
android:textColor="#000"
android:textSize="?android:actionBarItemBackground"
android:text="$640.00"/>
</FrameLayout>
you can achieve your requirement with this xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#d8d8d8" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="85dp"
android:layout_height="85dp"
android:background="#c8c8c8"
android:src="#drawable/ic_launcher" >
</ImageView>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/imageView1"
android:text="TextView"
android:textColor="#000000" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="6dp"
android:layout_marginTop="20dp"
android:padding="2dp"
android:text="2014-05-08"
android:textColor="#000000" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView2"
android:layout_marginRight="6dp"
android:layout_marginTop="20dp"
android:padding="2dp"
android:text="$600"
android:textColor="#000000"
android:textStyle="bold" />
</RelativeLayout>
hope this helps you.exact xml of you want to achieve.
<?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="wrap_content"
android:orientation="horizontal"
android:padding="5dip">
<ImageView
android:id="#+id/photo"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_margin="5dp"
android:padding="3dp"
android:scaleType="centerCrop"
android:layout_gravity="center"/>
<TextView
android:id="#+id/ListDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="#+id/right_container"
android:singleLine="true"
android:textSize="20sp"
android:text="Description"
android:ellipsize="end"
android:textStyle="bold"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/photo" />
<LinearLayout
android:id="#+id/right_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:orientation="vertical">
<TextView
android:id="#+id/ListDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#color/input_register"
android:text="12-11-2017"
android:layout_marginRight="10dp"/>
<TextView
android:id="#+id/ListAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="777$"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:textSize="20sp"
android:textColor="#color/violetred" />
</LinearLayout>
Use constraint layout for best performance. If not, use horizontal linear layout, with weight on the center one.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="5dip">
<ImageView
android:id="#+id/photo"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:background="#color/black"
android:scaleType="centerCrop" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:lines="1"
android:text="Buy drinks fvbfvfvfvasdasdasdfvfvvfvf" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="1014-05-08" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="$6969"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#mipmap/ic_launcher" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1.5"
android:ellipsize="end"
android:maxLines="1"
android:text="ASASJHGHHBHHJHJNKMKIKMKMKMKMKKNIKNIJ" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="2016-01-11" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="$640"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
try this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1"
android:padding="5dip">
<LinearLayout android:id="#+id/thumbnail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:weightSum=".20"
android:layout_alignParentLeft="true"
android:layout_marginRight="5dip">
<ImageView
android:id="#+id/photo"
android:layout_width="70dp"
android:layout_height="70dp"
android:scaleType="centerCrop"
android:layout_gravity="center"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum=".80"
android:layout_alignRight="#+id/thumbnail"
android:layout_alignParentRight="true"
android:orientation="vertical">
<TextView
android:id="#+id/ListDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginRight="10dp"
android:textColor="#color/input_register"
android:text="Date"
/>
<TextView
android:id="#+id/ListDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginRight="10dp"
android:textSize="20sp"
android:text="DescriptionDescriptionDescriptionDescription"
android:ellipsize="end"
android:textStyle="bold"
/>
<TextView
android:id="#+id/ListAmount"
android:text="Amount"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="end"
android:layout_marginRight="10dp"
android:layout_toRightOf="#+id/thumbnail"
android:textColor="#color/violetred" />
</LinearLayout>
</LinearLayout>
I want to create recyclerview by each list item has line vertical that custom.
But I create list item then line do not show.
custom_line
line_story_view.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="match_parent">
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="#EEEEEE"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:id="#+id/line_test" />
<View android:layout_width="10dp"
android:layout_height="10dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="45dp"
android:background="#drawable/bg_test_line" />
</RelativeLayout>
listitem
<?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"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<RelativeLayout
android:layout_width="95dp"
android:layout_height="wrap_content"
android:id="#+id/relativeLayout67">
<com.makeramen.roundedimageview.RoundedImageView
android:id="#+id/rv_profile"
android:layout_width="48dp"
android:layout_height="48dp"
app:riv_border_color="#cacaca"
app:riv_corner_radius="2dip"
android:src="#drawable/plachholder"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp" />
<TextView
android:id="#+id/tvwTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Loading..."
android:textAppearance="#style/AppTheme.TextAppearance"
android:textColor="#a3a3a3"
android:textSize="12dp"
android:layout_below="#+id/rv_profile"
android:layout_alignLeft="#+id/rv_profile"
android:layout_alignStart="#+id/rv_profile"
android:layout_marginTop="10dp" />
<com.example.bestiiz.component.LineStoryView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:id="#+id/line" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/relativeLayout67"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="40dp">
<TextView
android:id="#+id/tv_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="username"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="#212121" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="•"
android:id="#+id/textView73"
android:layout_alignBottom="#+id/tv_username"
android:layout_toRightOf="#+id/tv_username"
android:layout_toEndOf="#+id/tv_username"
android:layout_marginLeft="5dp"
android:textSize="12sp"
android:textColor="#BDBDBD" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp">
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/cv_profile"
android:layout_centerVertical="true"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
app:civ_border_color="#cacaca"
app:civ_border_width="0.5dp"
android:src="#drawable/plachholder" />
</RelativeLayout>
<TextView
android:id="#+id/tvwCaption"
android:focusable="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#3b3b3b"
android:textSize="13sp"
android:lineSpacingMultiplier="1.3"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="caption" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
picture example
When I use in my recyclerview then It is not showing line.
Thankyou and Sorry for bad english.
i have got an activity that has an image at the top of the screen. everything below the Image needs to be scrollable. see picture below:
I have tries placing the ScrollView Layout below the picture but i keep on getting an error saying "Unexpected end of statement" but the opening tag for ScrollView is correct so i am going crazy!
here is my XML code:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<RelativeLayout
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.rkmsolutions.restaurantapp.MainActivity">
<ImageView
android:id="#+id/sapori_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitStart"
android:src="#drawable/sapori_logo_cropped"
tools:ignore="ContentDescription" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/sapori_banner">
<ImageView
android:id="#+id/olivesAppetiserImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:src="#drawable/olives512x512"
tools:ignore="ContentDescription" />
<TextView
android:id="#+id/oliveAppetiserTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="#+id/olivesAppetiserImage"
android:layout_toRightOf="#+id/olivesAppetiserImage"
android:gravity="start"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="#string/olivesAppetizerTitleTxtView"
android:textColor="#b71c1c"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="#+id/oliveAppetisersBodyDescription"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/olivesAppetiserImage"
android:layout_below="#+id/oliveAppetiserTitle"
android:layout_toEndOf="#+id/olivesAppetiserImage"
android:layout_toRightOf="#+id/olivesAppetiserImage"
android:gravity="center_vertical"
android:text="#string/oliveAppetizerDescription" />
<TextView
android:id="#+id/oliveAppetiserPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/oliveAppetisersBodyDescription"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/oliveAppetiserTitle"
android:layout_toRightOf="#+id/oliveAppetisersBodyDescription"
android:gravity="center"
android:text="#string/oliveAppetiserPriceText" />
<ImageView
android:id="#+id/bruschettaAppetiserImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/olivesAppetiserImage"
android:scaleType="centerCrop"
android:src="#drawable/bruschetta512x512"
tools:ignore="ContentDescription" />
<TextView
android:id="#+id/bruschettaAppetiserTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/bruschettaAppetiserImage"
android:layout_toEndOf="#+id/bruschettaAppetiserImage"
android:layout_toRightOf="#+id/bruschettaAppetiserImage"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="#string/bruschettaAppetiserTitle"
android:textColor="#b71c1c"
android:textSize="15sp"
android:textStyle="bold"/>
<TextView
android:id="#+id/bruschettaAppetisersBodyDescription"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/bruschettaAppetiserImage"
android:layout_below="#+id/bruschettaAppetiserTitle"
android:layout_toEndOf="#+id/bruschettaAppetiserImage"
android:layout_toRightOf="#+id/bruschettaAppetiserImage"
android:gravity="center_vertical"
android:text="#string/bruschettaAppetiserDescription" />
<TextView
android:id="#+id/bruschettaAppetiserPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/bruschettaAppetiserImage"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/bruschettaAppetisersBodyDescription"
android:layout_toEndOf="#+id/bruschettaAppetisersBodyDescription"
android:layout_toRightOf="#+id/bruschettaAppetisersBodyDescription"
android:gravity="center_vertical"
android:text="#string/bruschettaAppetiserPriceText"
android:textAlignment="center" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:src="#drawable/vegetarian_bruschetta512x512"
tools:ignore="ContentDescription"
android:id="#+id/veggieBruschettaAppetiserImage"
android:layout_below="#+id/bruschettaAppetiserImage"/>
<TextView
android:id="#+id/veggieBruschettaAppetiserTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/veggieBruschettaAppetiserImage"
android:layout_toEndOf="#+id/veggieBruschettaAppetiserImage"
android:layout_toRightOf="#+id/veggieBruschettaAppetiserImage"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="#string/veggieBruschettaTitle"
android:textColor="#b71c1c"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="#+id/veggieBruschettaDescription"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/veggieBruschettaAppetiserImage"
android:layout_below="#+id/veggieBruschettaAppetiserTitle"
android:layout_toEndOf="#+id/bruschettaAppetiserImage"
android:layout_toRightOf="#+id/bruschettaAppetiserImage"
android:gravity="center_vertical"
android:text="Toasted bread with grilled vegetarian antipasti" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/veggieBruschettaPrice"
android:gravity="center"
android:textAlignment="center"
android:text="#string/veggieBruschettaPriceString"
android:layout_toRightOf="#id/veggieBruschettaDescription"
android:layout_toEndOf="#+id/veggieBruschettaDescription"
android:layout_alignTop="#+id/veggieBruschettaDescription"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignBottom="#+id/veggieBruschettaAppetiserImage"/>
<ImageView
android:id="#+id/paneAglioImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:layout_below="#+id/veggieBruschettaAppetiserImage"
android:src="#drawable/garlic_bread_pizza512x512"
tools:ignore="ContentDescription" />
<TextView
android:id="#+id/paneAglioTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/paneAglioImage"
android:layout_toEndOf="#+id/paneAglioImage"
android:layout_toRightOf="#+id/paneAglioImage"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="#string/paneAglioTitleString"
android:textColor="#b71c1c"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:id="#+id/paneAglioDescription"
android:gravity="center_vertical"
android:text="#string/paneAglioDescriptionString"
android:layout_toEndOf="#+id/paneAglioImage"
android:layout_toRightOf="#+id/paneAglioImage"
android:layout_below="#+id/paneAglioTitle"
android:layout_alignBottom="#+id/paneAglioImage"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:gravity="center"
android:textAlignment="center"
android:layout_alignBottom="#+id/paneAglioImage"
android:layout_toRightOf="#+id/paneAglioDescription"
android:layout_toEndOf="#+id/paneAglioDescription"
android:text="#string/paneAglioPriceString"
android:layout_alignTop="#+id/paneAglioDescription"/>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
it will be a simple solution but i just dont know what else to try!
thanks SO!
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.rkmsolutions.restaurantapp.MainActivity">
<ImageView
android:id="#+id/sapori_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitStart"
android:src="#drawable/sapori_logo_cropped"
tools:ignore="ContentDescription" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/sapori_banner">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ImageView
android:id="#+id/olivesAppetiserImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:src="#drawable/olives512x512"
tools:ignore="ContentDescription" />
<TextView
android:id="#+id/oliveAppetiserTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="#+id/olivesAppetiserImage"
android:layout_toRightOf="#+id/olivesAppetiserImage"
android:gravity="start"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="#string/olivesAppetizerTitleTxtView"
android:textColor="#b71c1c"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="#+id/oliveAppetisersBodyDescription"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/olivesAppetiserImage"
android:layout_below="#+id/oliveAppetiserTitle"
android:layout_toEndOf="#+id/olivesAppetiserImage"
android:layout_toRightOf="#+id/olivesAppetiserImage"
android:gravity="center_vertical"
android:text="#string/oliveAppetizerDescription" />
<TextView
android:id="#+id/oliveAppetiserPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/oliveAppetisersBodyDescription"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/oliveAppetiserTitle"
android:layout_toRightOf="#+id/oliveAppetisersBodyDescription"
android:gravity="center"
android:text="#string/oliveAppetiserPriceText" />
<ImageView
android:id="#+id/bruschettaAppetiserImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/olivesAppetiserImage"
android:scaleType="centerCrop"
android:src="#drawable/bruschetta512x512"
tools:ignore="ContentDescription" />
<TextView
android:id="#+id/bruschettaAppetiserTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/bruschettaAppetiserImage"
android:layout_toEndOf="#+id/bruschettaAppetiserImage"
android:layout_toRightOf="#+id/bruschettaAppetiserImage"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="#string/bruschettaAppetiserTitle"
android:textColor="#b71c1c"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="#+id/bruschettaAppetisersBodyDescription"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/bruschettaAppetiserImage"
android:layout_below="#+id/bruschettaAppetiserTitle"
android:layout_toEndOf="#+id/bruschettaAppetiserImage"
android:layout_toRightOf="#+id/bruschettaAppetiserImage"
android:gravity="center_vertical"
android:text="#string/bruschettaAppetiserDescription" />
<TextView
android:id="#+id/bruschettaAppetiserPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/bruschettaAppetiserImage"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/bruschettaAppetisersBodyDescription"
android:layout_toEndOf="#+id/bruschettaAppetisersBodyDescription"
android:layout_toRightOf="#+id/bruschettaAppetisersBodyDescription"
android:gravity="center_vertical"
android:text="#string/bruschettaAppetiserPriceText"
android:textAlignment="center" />
<ImageView
android:id="#+id/veggieBruschettaAppetiserImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/bruschettaAppetiserImage"
android:scaleType="centerCrop"
android:src="#drawable/vegetarian_bruschetta512x512"
tools:ignore="ContentDescription" />
<TextView
android:id="#+id/veggieBruschettaAppetiserTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/veggieBruschettaAppetiserImage"
android:layout_toEndOf="#+id/veggieBruschettaAppetiserImage"
android:layout_toRightOf="#+id/veggieBruschettaAppetiserImage"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="#string/veggieBruschettaTitle"
android:textColor="#b71c1c"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="#+id/veggieBruschettaDescription"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/veggieBruschettaAppetiserImage"
android:layout_below="#+id/veggieBruschettaAppetiserTitle"
android:layout_toEndOf="#+id/bruschettaAppetiserImage"
android:layout_toRightOf="#+id/bruschettaAppetiserImage"
android:gravity="center_vertical"
android:text="Toasted bread with grilled vegetarian antipasti" />
<TextView
android:id="#+id/veggieBruschettaPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/veggieBruschettaAppetiserImage"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/veggieBruschettaDescription"
android:layout_toEndOf="#+id/veggieBruschettaDescription"
android:layout_toRightOf="#id/veggieBruschettaDescription"
android:gravity="center"
android:text="#string/veggieBruschettaPriceString"
android:textAlignment="center" />
<ImageView
android:id="#+id/paneAglioImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/veggieBruschettaAppetiserImage"
android:scaleType="centerCrop"
android:src="#drawable/garlic_bread_pizza512x512"
tools:ignore="ContentDescription" />
<TextView
android:id="#+id/paneAglioTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/paneAglioImage"
android:layout_toEndOf="#+id/paneAglioImage"
android:layout_toRightOf="#+id/paneAglioImage"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="#string/paneAglioTitleString"
android:textColor="#b71c1c"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="#+id/paneAglioDescription"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/paneAglioImage"
android:layout_below="#+id/paneAglioTitle"
android:layout_toEndOf="#+id/paneAglioImage"
android:layout_toRightOf="#+id/paneAglioImage"
android:gravity="center_vertical"
android:text="#string/paneAglioDescriptionString" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/paneAglioImage"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/paneAglioDescription"
android:layout_toEndOf="#+id/paneAglioDescription"
android:layout_toRightOf="#+id/paneAglioDescription"
android:gravity="center"
android:text="#string/paneAglioPriceString"
android:textAlignment="center" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
You should put your ImageView on a RelativeLayout with alignParentTop attribute. And you should define a container layout for your ImageView and TextViews.
Key point here ; ScrollView can only host one children. So you will add your container layout inside ScrollView and you will define layout_below attribute to make it below on your banner
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.rkmsolutions.restaurantapp.MainActivity">
<ImageView
android:id="#+id/sapori_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitStart"
android:src="#drawable/sapori_logo_cropped"
tools:ignore="ContentDescription" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/sapori_banner">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ImageView
android:id="#+id/olivesAppetiserImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:src="#drawable/olives512x512"
tools:ignore="ContentDescription" />
<TextView
android:id="#+id/oliveAppetiserTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="#+id/olivesAppetiserImage"
android:layout_toRightOf="#+id/olivesAppetiserImage"
android:gravity="start"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="#string/olivesAppetizerTitleTxtView"
android:textColor="#b71c1c"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="#+id/oliveAppetisersBodyDescription"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/olivesAppetiserImage"
android:layout_below="#+id/oliveAppetiserTitle"
android:layout_toEndOf="#+id/olivesAppetiserImage"
android:layout_toRightOf="#+id/olivesAppetiserImage"
android:gravity="center_vertical"
android:text="#string/oliveAppetizerDescription" />
<TextView
android:id="#+id/oliveAppetiserPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/oliveAppetisersBodyDescription"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/oliveAppetiserTitle"
android:layout_toRightOf="#+id/oliveAppetisersBodyDescription"
android:gravity="center"
android:text="#string/oliveAppetiserPriceText" />
<ImageView
android:id="#+id/bruschettaAppetiserImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/olivesAppetiserImage"
android:scaleType="centerCrop"
android:src="#drawable/bruschetta512x512"
tools:ignore="ContentDescription" />
<TextView
android:id="#+id/bruschettaAppetiserTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/bruschettaAppetiserImage"
android:layout_toEndOf="#+id/bruschettaAppetiserImage"
android:layout_toRightOf="#+id/bruschettaAppetiserImage"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="#string/bruschettaAppetiserTitle"
android:textColor="#b71c1c"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="#+id/bruschettaAppetisersBodyDescription"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/bruschettaAppetiserImage"
android:layout_below="#+id/bruschettaAppetiserTitle"
android:layout_toEndOf="#+id/bruschettaAppetiserImage"
android:layout_toRightOf="#+id/bruschettaAppetiserImage"
android:gravity="center_vertical"
android:text="#string/bruschettaAppetiserDescription" />
<TextView
android:id="#+id/bruschettaAppetiserPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/bruschettaAppetiserImage"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/bruschettaAppetisersBodyDescription"
android:layout_toEndOf="#+id/bruschettaAppetisersBodyDescription"
android:layout_toRightOf="#+id/bruschettaAppetisersBodyDescription"
android:gravity="center_vertical"
android:text="#string/bruschettaAppetiserPriceText"
android:textAlignment="center" />
<ImageView
android:id="#+id/veggieBruschettaAppetiserImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/bruschettaAppetiserImage"
android:scaleType="centerCrop"
android:src="#drawable/vegetarian_bruschetta512x512"
tools:ignore="ContentDescription" />
<TextView
android:id="#+id/veggieBruschettaAppetiserTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/veggieBruschettaAppetiserImage"
android:layout_toEndOf="#+id/veggieBruschettaAppetiserImage"
android:layout_toRightOf="#+id/veggieBruschettaAppetiserImage"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="#string/veggieBruschettaTitle"
android:textColor="#b71c1c"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="#+id/veggieBruschettaDescription"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/veggieBruschettaAppetiserImage"
android:layout_below="#+id/veggieBruschettaAppetiserTitle"
android:layout_toEndOf="#+id/bruschettaAppetiserImage"
android:layout_toRightOf="#+id/bruschettaAppetiserImage"
android:gravity="center_vertical"
android:text="Toasted bread with grilled vegetarian antipasti" />
<TextView
android:id="#+id/veggieBruschettaPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/veggieBruschettaAppetiserImage"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/veggieBruschettaDescription"
android:layout_toEndOf="#+id/veggieBruschettaDescription"
android:layout_toRightOf="#id/veggieBruschettaDescription"
android:gravity="center"
android:text="#string/veggieBruschettaPriceString"
android:textAlignment="center" />
<ImageView
android:id="#+id/paneAglioImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/veggieBruschettaAppetiserImage"
android:scaleType="centerCrop"
android:src="#drawable/garlic_bread_pizza512x512"
tools:ignore="ContentDescription" />
<TextView
android:id="#+id/paneAglioTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/paneAglioImage"
android:layout_toEndOf="#+id/paneAglioImage"
android:layout_toRightOf="#+id/paneAglioImage"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="#string/paneAglioTitleString"
android:textColor="#b71c1c"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="#+id/paneAglioDescription"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/paneAglioImage"
android:layout_below="#+id/paneAglioTitle"
android:layout_toEndOf="#+id/paneAglioImage"
android:layout_toRightOf="#+id/paneAglioImage"
android:gravity="center_vertical"
android:text="#string/paneAglioDescriptionString" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/paneAglioImage"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/paneAglioDescription"
android:layout_toEndOf="#+id/paneAglioDescription"
android:layout_toRightOf="#+id/paneAglioDescription"
android:gravity="center"
android:text="#string/paneAglioPriceString"
android:textAlignment="center" />
</RelativeLayout>
Try this way it will work
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:ads="http://schemas.android.com/apk/res-auto">
<RelativeLayout
android:id="#+id/header"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_alignParentTop="true"
android:background="#689F38"
android:gravity="center"
android:layout_gravity="center">
<TextView
android:id="#+id/header_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/header_msg"
android:textColor="#FFFFFF"
android:textSize="25sp"/>
</RelativeLayout>
<RelativeLayout
android:id="#+id/footer"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_alignParentBottom="true"
android:background="#689F38"
android:gravity="center"
android:layout_gravity="center">
<TextView
android:id="#+id/footer_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/footer_msg"
android:textColor="#FFFFFF"
android:gravity="center"
android:textSize="25sp"/>
</RelativeLayout>
<ScrollView
android:id="#+id/scroll_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#+id/footer"
android:layout_below="#+id/header"
android:fillViewport="true">
<LinearLayout
android:id="#+id/myLayout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:fillViewport="true">
<TextView
android:id="#+id/bodytext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/body_msg"
android:textColor="#F44336"
android:gravity="center"
android:textSize="25sp"/>
</LinearLayout>
</ScrollView>
</RelativeLayout>
For more check this
I inflate layout to listview and here is what I want:
But I always get something like this:
As you see, the button is always align at the bottom of parent. Here is my xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff" >
<ImageView
android:id="#+id/img_icon_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="5dp" />
<TextView
android:id="#+id/txt_title_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/img_icon_type"
android:text="TextView"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/txt_post_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_title_type"
android:layout_marginTop="16dp"
android:layout_toRightOf="#+id/img_icon_type"
android:text="TextView"
android:textSize="15sp" />
<TextView
android:id="#+id/txt_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_post_time"
android:layout_toRightOf="#+id/img_icon_type"
android:text="TextView"
android:textSize="15sp" />
<ImageView
android:id="#+id/img_edit_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:onClick="openPostMenu"
android:src="#drawable/btn_memo_menu" />
<TextView
android:id="#+id/txt_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/img_icon_type"
android:layout_margin="10dp"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="TextView"
android:textSize="20sp" />
<ImageView
android:id="#+id/img_posted"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_below="#+id/txt_status"
android:layout_centerHorizontal="true"
android:src="#drawable/ic_launcher" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/img_posted"
android:layout_alignRight="#+id/img_posted"
android:layout_below="#+id/img_posted" >
<RelativeLayout
android:id="#+id/btn_confirm_route"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
android:background="#f2f2f2" >
<TextView
android:id="#+id/txt_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="#string/現在地からのル一トを確認" />
<ImageView
android:layout_width="20sp"
android:layout_height="20sp"
android:layout_centerVertical="true"
android:layout_toLeftOf="#+id/txt_address"
android:src="#drawable/btn_memo_route_search_pressed" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
Please help me to fix this!Thank you!
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>