I have an activity in which I am using the fragment. In fragment I have custom toolbar, a list and a EditTextView. When Keyboard visible in this Activity, it pushes up layout. How can I prevent the toolbar to be at its original position.
Following code is written in my fragment:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/layout_alert_main_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/bg_hexa">
<TextView
android:id="#+id/channel_title"
android:paddingLeft="10dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:background="#color/black"
android:textColor="#color/white"
android:textSize="16sp"
android:visibility="gone"
android:layout_below="#id/layout_alert_top"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:id="#+id/layout_alert_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"
android:background="#color/app_blue"
android:orientation="horizontal">
<RelativeLayout
android:id="#+id/layout_channel_back_view"
android:layout_width="50dp"
android:layout_height="50dp"
android:clickable="true"
android:focusable="true">
<ImageView
android:id="#+id/title_bar_left_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/ic_menu_white_32"/>
</RelativeLayout>
<TextView
android:id="#+id/tv_screen_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="#string/channel_title"
android:layout_centerInParent="true"
android:textSize="24sp"
android:textColor="#color/white_text"/>
<RelativeLayout
android:id="#+id/channels_sliding_menu"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:clickable="true"
android:focusable="true">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/ic_tab_channels_white"/>
</RelativeLayout>
</RelativeLayout>
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer_layout"
android:layout_below="#+id/channel_title"
android:isScrollContainer="false"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/layout_list_alerts"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<TextView
android:id="#+id/zero_conversation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="#color/dark_gray_text"
android:layout_centerInParent="true"
android:text="Empty"
android:visibility="gone"/>
<RelativeLayout
android:id="#+id/layout_type_message"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:background="#color/gray">
<EditText
android:id="#+id/et_type_message"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toLeftOf="#+id/layout_send_message"
android:background="#drawable/square_round_corners"
android:hint="Type your message.."
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:padding="5dp"
android:singleLine="true"
android:textColor="#color/black"
android:textColorHint="#color/black"
android:textSize="16sp"/>
<Button
android:id="#+id/layout_send_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_alignParentRight="true"
android:padding="5dp"
android:textSize="16sp"
android:textStyle="bold"
android:background="#color/transparent"
android:textColor="#color/dark_gray_text"
android:layout_centerInParent="true"
android:text="Send"/>
</RelativeLayout>
<ListView
android:id="#+id/conversation_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#id/layout_type_message"
android:divider="#null"
android:listSelector="#color/transparent"
android:stackFromBottom="true"
android:transcriptMode="normal"
/>
</RelativeLayout>
<FrameLayout
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false" >
</FrameLayout>
<ListView
android:id="#+id/channels_list"
android:background="#color/gray"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#null"
android:layout_gravity="right"
android:choiceMode="singleChoice" />
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>
Hello, Try to apply this attribute in Activity Tag in Manifest file and let me know if you
can get your desired output or not. Okay.
android:windowSoftInputMode="stateAlwaysHidden|adjustResize"
> XML file` :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/layout_alert_main_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFF">
<RelativeLayout
android:id="#+id/layout_alert_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#000000"
android:orientation="horizontal"
android:visibility="visible">
<RelativeLayout
android:id="#+id/layout_channel_back_view"
android:layout_width="50dp"
android:layout_height="50dp"
android:clickable="true"
android:focusable="true">
<ImageView
android:id="#+id/title_bar_left_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#FFFFFF" />
</RelativeLayout>
<TextView
android:id="#+id/tv_screen_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:text="Title"
android:textColor="#FFFFFF"
android:textSize="24sp" />
<RelativeLayout
android:id="#+id/channels_sliding_menu"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:clickable="true"
android:focusable="true">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/ic_logo" />
</RelativeLayout>
</RelativeLayout>
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:isScrollContainer="false">
<RelativeLayout
android:id="#+id/layout_list_alerts"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/zero_conversation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="Empty"
android:textColor="#000000"
android:textSize="16sp"
android:visibility="gone" />
<RelativeLayout
android:id="#+id/layout_type_message"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:background="#000000"
android:orientation="horizontal">
<EditText
android:id="#+id/et_type_message"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_toLeftOf="#+id/layout_send_message"
android:background="#FFFFFF"
android:hint="Type your message.."
android:padding="5dp"
android:singleLine="true"
android:textColor="#000000"
android:textColorHint="#000000"
android:textSize="16sp" />
<Button
android:id="#+id/layout_send_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:background="#000000"
android:padding="5dp"
android:text="Send"
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
<ListView
android:id="#+id/conversation_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#id/layout_type_message"
android:divider="#null"
android:stackFromBottom="true"
android:transcriptMode="normal" />
</RelativeLayout>
<FrameLayout
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"></FrameLayout>
<ListView
android:id="#+id/channels_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="right"
android:background="#000000"
android:choiceMode="singleChoice"
android:divider="#null"
tools:listtem="#layout/demo_layout" />
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>
Use Scroll view in Ur Layout or Use the code in the manifest.xml.
<activity android:windowSoftInputMode="adjustPan">
Read this :
http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft
and use adjustPan
Related
I am making an android app that has a cardview inside a recyclerview. Cardview looks good on tablet and takes 40% size of screen. When i run it on a 5" android device, cardview covers 80% of screen size. Please check the code below and suggest some solutions to correct layout that automatically fits itself according to the screen sizes.
MainLayout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/main_linearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="false"
android:layout_alignParentEnd="true"
android:layout_below="#+id/empty_view"
android:orientation="vertical">
<SearchView
android:id="#+id/searchbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerview"
android:layout_width="match_parent"
android:scrollbars="vertical"
android:clipToPadding="false"
android:layout_height="0dp"
android:layout_weight="1"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Load More"
android:id="#+id/btnLoad"
android:layout_gravity="center_horizontal"
android:layout_below="#+id/recyclerview"
android:background="#42a7f4" />
</LinearLayout>
</LinearLayout>
CardViewTemplate.xml
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_height="wrap_content"
android:layout_width="match_parent">
<android.support.v7.widget.CardView
android:id="#+id/card_view"
android:layout_gravity="start"
android:layout_width="match_parent"
card_view:cardUseCompatPadding="true"
android:layout_height="500dp"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
card_view:contentPaddingLeft="5dp"
card_view:contentPaddingRight="5dp"
card_view:contentPaddingTop="5dp"
card_view:cardCornerRadius="0dp">
<RelativeLayout
android:layout_height="match_parent"
android:layout_width="match_parent">
<LinearLayout
android:id="#+id/greenBoxView"
android:background="#EBEFF2"
android:layout_height="50dp"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_alignParentTop="true"
>
<ImageView
android:layout_height="30dp"
android:layout_width="30dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="5dp"
android:src="#drawable/lab"
android:layout_gravity="center_vertical"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Yay! This is a Sample Title Text"
android:textColor="#002868"
android:textStyle="bold"
android:paddingRight="70dp"
android:paddingLeft="60dp"
android:textSize="25dp"
android:layout_gravity="center_vertical" />
<ImageView
android:layout_height="30dp"
android:layout_width="30dp"
android:layout_alignParentRight="true"
android:src="#drawable/lab"
android:layout_marginRight="8dp"
android:layout_gravity="center_vertical"
/>
</LinearLayout>
<LinearLayout
android:layout_below="#id/greenBoxView"
android:layout_above="#+id/footer"
android:id="#+id/centeralPart"
android:paddingTop="5dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000"
android:textSize="20dp"
android:id="#+id/txtMaintitle" />
<TextView
android:textColor="#0080ff"
android:textSize="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/txtSecondTitle" />
<ListView
android:id="#+id/mainlist_view"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:divider="#null"
android:dividerHeight="0dp"/>
</LinearLayout>
<LinearLayout
android:id="#id/footer"
android:layout_height="80dp"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:gravity="center_horizontal"
android:orientation="horizontal">
<Button
android:id="#+id/btnOrder"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Order"
android:background="#00AF50"
android:textColor="#FFFFFF"
android:layout_marginRight="10dp" />
<Button
android:id="#+id/btnCompare"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Compare"
android:textColor="#FFFFFF"
android:background="#0071C1" />
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
This is what CardViewTemplate.xml should look like:
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="HardcodedText,ContentDescription" >
<android.support.v7.widget.CardView
android:id="#+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
card_view:cardCornerRadius="0dp"
card_view:cardUseCompatPadding="true"
card_view:contentPaddingLeft="5dp"
card_view:contentPaddingRight="5dp"
card_view:contentPaddingTop="5dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/greenBoxView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EBEFF2"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="5dp"
android:src="#drawable/lab"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingEnd="70dp"
android:paddingStart="60dp"
android:text="Yay! This is a Sample Title Text"
android:textColor="#002868"
android:textSize="25sp"
android:textStyle="bold" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="8dp"
android:src="#drawable/lab" />
</LinearLayout>
<LinearLayout
android:id="#+id/centeralPart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/footer"
android:layout_below="#id/greenBoxView"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="5dp">
<TextView
android:id="#+id/txtMaintitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000"
android:textSize="20sp" />
<TextView
android:id="#+id/txtSecondTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#0080ff"
android:textSize="20sp" />
<ListView
android:id="#+id/mainlist_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#null"
android:dividerHeight="0dp" />
</LinearLayout>
<LinearLayout
android:id="#id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center_horizontal"
android:orientation="horizontal">
<Button
android:id="#+id/btnOrder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:background="#00AF50"
android:text="Order"
android:textColor="#FFFFFF" />
<Button
android:id="#+id/btnCompare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="#0071C1"
android:text="Compare"
android:textColor="#FFFFFF" />
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
In case this does not fit with your idea, please provide a screenshot of an inflated item view or a drawing of the layout.
I have already with adjustresize and adjustpan also but nothing worked for me here.
Here is 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:orientation="vertical"
android:background="#color/gray"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="9">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:id="#+id/relativeLayout2">
<ImageView
android:layout_width="match_parent"
android:src="#drawable/backgroiund"
android:scaleType="fitXY"
android:layout_height="match_parent" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="500dp"
android:background="#FFFFFF"
android:id="#+id/relativeLayout"
android:orientation="vertical"
android:layout_marginTop="120dp"
android:layout_centerHorizontal="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="65dp">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="120dp">
<TextView
android:layout_width="match_parent"
android:text="Srinivas"
android:id="#+id/user_name"
android:textSize="25sp"
android:gravity="center"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:text="Android Developer"
android:textSize="18sp"
android:layout_marginTop="10dp"
android:gravity="center"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:text="Tadepalligudem,West Godavari"
android:layout_marginTop="10dp"
android:gravity="center"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:background="#drawable/boarder"
android:layout_marginLeft="20dp"
android:layout_gravity="center"
android:layout_marginRight="20dp"
android:layout_height="40dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:textSize="18sp"
android:text="about"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:layout_marginTop="10dp"
android:background="#dfdfdf"/>
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="100dp">
<TextView
android:layout_width="match_parent"
android:text="Intrests"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#A9A9A9"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_gravity="center"
android:gravity="center"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="#drawable/bg1"
android:layout_weight="8.5">
<ImageView
android:id="#+id/editsearch"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="18dp"
android:layout_gravity="center"
android:foregroundGravity="center"
android:src="#drawable/search" />
<EditText
android:id="#+id/name"
android:layout_width="0dp"
android:layout_weight="9"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:backgroundTint="#00000000"
android:inputType="textCapSentences"
android:hint="Search Intrests"
android:singleLine="true"
android:layout_gravity="center"
android:background="#null"
android:padding="2dp"
android:textColorHint="#9B9B9B"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:id="#+id/buton_layout"
android:orientation="vertical"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#drawable/boarder">
<ScrollView
android:id="#+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.buzzed.utils.FlowLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/flow_container1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:paddingBottom="10dp"
app:elementSpacing="5dp"
app:flowDirection="leftToRight"
app:lineSpacing="14dp" />
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_height="80dp"
android:layout_width="match_parent">
<Button
android:layout_width="match_parent"
android:background="#drawable/circlecorner1"
android:text="save"
android:textSize="18sp"
android:layout_marginTop="10dp"
android:id="#+id/save"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:onClick="save"
android:layout_gravity="top"
android:textColor="#color/White"
android:layout_height="40dp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:id="#+id/list_layout"
android:orientation="vertical"
android:visibility="gone"
android:layout_height="match_parent">
<ListView
android:id="#+id/listview"
android:layout_width="match_parent"
android:layout_height="match_parent"></ListView>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/user_pic"
android:layout_width="140dp"
android:layout_height="140dp"
android:layout_gravity="center"
android:src="#drawable/grey_round"
android:layout_marginTop="37dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#FFFFFF"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_weight="1">
</LinearLayout>
</LinearLayout>
When I used AdjustPan nothing happened but when I tried with AdjustResize the screen is scrollable and I can move it manually but what I need is to move screen automatically when keyboard open and yes it is happening in fragment. Please help me .
I have ParallaxScrollView which contain two ListViews and also TextViews it's working fine in all the devices but In Tablet(croma CRXT1125Q)the last item cut off in the first ListView, I have made the Tablet layout also but i didn't got any succeed. Please guyz help to solve it.
Help will be appreciate.
My xml looks like as below
<?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"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
android:orientation="vertical">
<cutomView.ParallaxScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbars="none"
android:visibility="gone"
app:parallax_factor="1.9">
<RelativeLayout xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.CardView
android:id="#+id/cardAmount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorGreyBackground"
android:elevation="#dimen/viewmargin"
card_view:cardPreventCornerOverlap="false"
card_view:contentPaddingLeft="#dimen/negContentPadding"
card_view:contentPaddingRight="#dimen/negContentPadding"
card_view:contentPaddingTop="#dimen/negContentPadding">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">
<RelativeLayout
android:id="#+id/relPackagePhoto"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imgPackage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY" />
<View
android:id="#+id/mTranspherentView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/trending_gradient_shape" />
<cutomView.TextViewAvenirMedium
android:id="#+id/txtPackageName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/mTranspherentView"
android:layout_centerHorizontal="true"
android:maxLines="2"
android:padding="#dimen/small_margine"
android:singleLine="false"
android:text=""
android:textColor="#color/white"
android:textSize="#dimen/small_font" />
<ProgressBar
android:id="#+id/mProgressBar"
style="?android:attr/progressBarStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="#dimen/margin_leftt"
android:layout_below="#+id/relPackagePhoto"
android:layout_centerVertical="true"
android:orientation="horizontal"
android:weightSum="3">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1">
<cutomView.TextViewAvenirMedium
android:id="#+id/txtOutstandingAmount"
style="#style/CustomBlackTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="center"
android:maxLines="2"
android:padding="#dimen/main_margin"
android:singleLine="false"
android:text="#string/total_due_amount"
android:textColor="#color/blue_text"
android:textSize="#dimen/normal_font" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1">
<cutomView.TextViewAvenirMedium
android:id="#+id/txtTotalAmount"
style="#style/CustomBlackTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="center"
android:padding="#dimen/main_margin"
android:text=""
android:textSize="#dimen/normal_font" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1">
<cutomView.TextViewAvenirMedium
android:id="#+id/txtPayNow"
style="#style/CustomBlackTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:background="#drawable/darkbluebutton"
android:gravity="center"
android:padding="#dimen/main_margin"
android:text="#string/pay_now"
android:textColor="#color/white"
android:textSize="#dimen/normal_font" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/cardAmount"
android:layout_marginTop="#dimen/margin_left"
card_view:cardCornerRadius="0dp"
card_view:cardElevation="2dp"
card_view:cardPreventCornerOverlap="false"
card_view:cardUseCompatPadding="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/main_margin"
android:layout_marginRight="#dimen/main_margin"
android:orientation="vertical">
<ListView
android:id="#+id/listPaidPayment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cacheColorHint="#00000000"
android:divider="#null"
android:dividerHeight="#dimen/small_margine"
android:fastScrollEnabled="true"
android:listSelector="#android:color/transparent"
android:scrollbars="none"
android:smoothScrollbar="true" />
<View
android:id="#+id/viewSeperator"
android:layout_width="match_parent"
android:layout_height="#dimen/view_width"
android:layout_marginLeft="#dimen/margin_top_"
android:layout_marginRight="#dimen/main_margin"
android:layout_marginTop="#dimen/main_margin"
android:background="#color/darkGreyCardBg"
android:visibility="gone" />
</LinearLayout>
<cutomView.TextViewAvenirMedium
android:id="#+id/txtDueAmount"
style="#style/CustomBlackTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="#dimen/margin_left"
android:background="#color/footertext"
android:gravity="center"
android:padding="#dimen/main_margin"
android:text="#string/total_due_amount"
android:textColor="#color/white"
android:textSize="#dimen/normal_font" />
<ListView
android:id="#+id/listDuePayment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/main_margin"
android:layout_marginRight="#dimen/main_margin"
android:cacheColorHint="#00000000"
android:divider="#null"
android:dividerHeight="#dimen/small_margine"
android:fastScrollEnabled="true"
android:listSelector="#android:color/transparent"
android:scrollbars="none"
android:smoothScrollbar="true" />
</LinearLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
</cutomView.ParallaxScrollView>
</LinearLayout>
i am trying to show one gridview while selecting some photo from gallery and showing list with recyclerview in a fragment. my layout working well if i do not use swipe refresh layout. can you solve this why this layout not working while using swipe refreshlayout.
xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="com.systechdigital.webadeal.NewsfeedFragment"
android:orientation="vertical"
android:background="#969696"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#023956"
>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="50dp"
android:src="#drawable/globe"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:id="#+id/notificationButtonId"
android:background="?android:attr/selectableItemBackground"
android:paddingRight="10dp"
/>
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:paddingBottom="10dp"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Share you thoughts here..."
android:paddingLeft="10dp"
android:background="#drawable/edittext_status_background"
android:padding="20dp"
android:elevation="5dp"
android:id="#+id/editTextWritePostId"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:fitsSystemWindows="true"
android:background="#f9f9f9"
>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Post"
android:textColor="#ffffff"
android:background="#1470a6"
android:id="#+id/postButtonId"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/checkInButtonId"
android:layout_toLeftOf="#+id/smileyButtonId"
android:layout_centerInParent="true"
android:src="#drawable/ic_checkin"
android:background="#android:color/transparent"
android:layout_marginRight="3dp"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/smiley"
android:layout_toLeftOf="#+id/imageUploadButtonId"
android:layout_centerInParent="true"
android:layout_marginRight="10dp"
android:id="#+id/smileyButtonId"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/camera"
android:layout_toLeftOf="#+id/videoUploadButtonId"
android:layout_centerInParent="true"
android:layout_alignParentEnd="true"
android:layout_marginRight="10dp"
android:id="#+id/imageUploadButtonId"
/>
</RelativeLayout>
<GridView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/gridViewId"
android:layout_below="#+id/postButtonId"
android:numColumns="auto_fit"
android:columnWidth="100dp"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:layout_marginTop="5dp"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/underline"
android:minHeight="0dp"
/>
**<android.support.v4.widget.SwipeRefreshLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/swipeRefreshLayoutId"
>**
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/recyclerviewId_newsFeed"
android:nestedScrollingEnabled="true"
/>
**</android.support.v4.widget.SwipeRefreshLayout>**
</LinearLayout>
</ScrollView>
</LinearLayout>
1. Don't use GridView, ListView or RecyclerView inside ScrollView. Use NestedScrollView instead of your ScrollView.
NestedScrollView is just like ScrollView, but it supports acting as
both a nested scrolling parent and child on both new and old versions
of Android.
2. Use SwipeRefreshLayout as parent of NestedScrollView.
3. Use attribute android:descendantFocusability="blocksDescendants" to LinearLayout instead of android:descendantFocusability="beforeDescendants".
4. Use attribute android:nestedScrollingEnabled="false" to RecyclerView.
Update your layout as below:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#969696">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#023956">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="50dp"
android:src="#drawable/ic_group"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:id="#+id/notificationButtonId"
android:background="?android:attr/selectableItemBackground"
android:paddingRight="10dp" />
</RelativeLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/swipeRefreshLayoutId">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:paddingBottom="10dp"
android:descendantFocusability="blocksDescendants">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Share you thoughts here..."
android:paddingLeft="10dp"
android:padding="20dp"
android:elevation="5dp"
android:id="#+id/editTextWritePostId" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:fitsSystemWindows="true"
android:background="#f9f9f9">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Post"
android:textColor="#ffffff"
android:background="#1470a6"
android:id="#+id/postButtonId" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/checkInButtonId"
android:layout_toLeftOf="#+id/smileyButtonId"
android:layout_centerInParent="true"
android:src="#drawable/ic_action_cart"
android:background="#android:color/transparent"
android:layout_marginRight="3dp" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/ic_play"
android:layout_toLeftOf="#+id/imageUploadButtonId"
android:layout_centerInParent="true"
android:layout_marginRight="10dp"
android:id="#+id/smileyButtonId" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/ic_camera"
android:layout_centerInParent="true"
android:layout_alignParentEnd="true"
android:layout_marginRight="10dp"
android:id="#+id/imageUploadButtonId" />
</RelativeLayout>
<GridView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/gridViewId"
android:layout_below="#+id/postButtonId"
android:numColumns="auto_fit"
android:columnWidth="100dp"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:layout_marginTop="5dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="0dp" />
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerviewId_newsFeed"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="false" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
Hope this will help~
just replace your swipe view at top of your layout like this
<android.support.v4.widget.SwipeRefreshLayout
android:id="#+id/swipeRefreshLayoutId"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#969696"
android:orientation="vertical"
tools:context="com.systechdigital.webadeal.NewsfeedFragment"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#023956">
<ImageButton
android:id="#+id/notificationButtonId"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:background="?android:attr/selectableItemBackground"
android:paddingRight="10dp"
android:src="#drawable/globe" />
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
android:orientation="vertical"
android:paddingBottom="10dp">
<EditText
android:id="#+id/editTextWritePostId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/edittext_status_background"
android:elevation="5dp"
android:hint="Share you thoughts here..."
android:padding="20dp"
android:paddingLeft="10dp"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="#f9f9f9"
android:fitsSystemWindows="true">
<Button
android:id="#+id/postButtonId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#1470a6"
android:text="Post"
android:textColor="#ffffff" />
<ImageButton
android:id="#+id/checkInButtonId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginRight="3dp"
android:layout_toLeftOf="#+id/smileyButtonId"
android:background="#android:color/transparent"
android:src="#drawable/ic_checkin" />
<ImageButton
android:id="#+id/smileyButtonId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginRight="10dp"
android:layout_toLeftOf="#+id/imageUploadButtonId"
android:background="#drawable/smiley" />
<ImageButton
android:id="#+id/imageUploadButtonId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerInParent="true"
android:layout_marginRight="10dp"
android:layout_toLeftOf="#+id/videoUploadButtonId"
android:background="#drawable/camera" />
</RelativeLayout>
<GridView
android:id="#+id/gridViewId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/postButtonId"
android:layout_marginTop="5dp"
android:columnWidth="100dp"
android:horizontalSpacing="10dp"
android:numColumns="auto_fit"
android:verticalSpacing="10dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/underline"
android:minHeight="0dp" />
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerviewId_newsFeed"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="true" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>
I want to display some text in the middle of the screen, below header and above footer. Since this text is very long I nested it in ScrollView. I have tried a number of solutions: this, this, this, this, and a bunch more...
At first I had a problem of the two relative_layouts overlapping and text being cut of. The most accepted answer is to use layout_above and layout_below, but when I use layout_above, the text is never displayed.
This is what my xml looks like:
<?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"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/linear_layout_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/gray"
android:baselineAligned="false"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<ImageView
android:id="#+id/profile_image"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_margin="10dp"
android:contentDescription="#string/profile_photo"
android:src="#drawable/default_profile"
tools:ignore="RtlHardcoded" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/scrollViewAndStuff"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_above="#+id/ln_layout_footer"
android:layout_below="#+id/linear_layout_header">
<ScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
tools:ignore="UselessParent">
<TextView
android:id="#+id/meetupDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="#string/text"/>-
</ScrollView>
</RelativeLayout>
<RelativeLayout
android:id="#+id/ln_layout_footer"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:layout_height="match_parent"
android:gravity="bottom"
android:orientation="horizontal"
android:paddingTop="10dp">
<LinearLayout
android:id="#+id/ln_layout"
android:layout_width="fill_parent"
android:background="#color/gray"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<TextView
android:id="#+id/red"
android:textColor="#color/white"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/red" />
<TextView
android:id="#+id/blue"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="#color/white"
android:layout_weight="1"
android:gravity="center"
android:text="#string/blue" />
<TextView
android:id="#+id/green"
android:layout_width="match_parent"
android:textColor="#color/white"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/green" />
</LinearLayout>
</RelativeLayout>
in your ln_layout_footer
set android:layout_height="wrap_content"
Edited
<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"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/linear_layout_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/dark_gray_pressed"
android:baselineAligned="false"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<ImageView
android:id="#+id/profile_image"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_margin="10dp"
android:contentDescription="#string/action_settings"
android:src="#drawable/img_splash_logo"
tools:ignore="RtlHardcoded" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/scrollViewAndStuff"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/ln_layout_footer"
android:layout_below="#+id/linear_layout_header">
<ScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
tools:ignore="UselessParent">
<TextView
android:id="#+id/meetupDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="#string/txt_price" />-
</ScrollView>
</RelativeLayout>
<RelativeLayout
android:id="#+id/ln_layout_footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="bottom"
android:orientation="horizontal"
android:paddingTop="10dp">
<LinearLayout
android:id="#+id/ln_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/dark_gray"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<TextView
android:id="#+id/red"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/txt_quantity"
android:textColor="#color/white" />
<TextView
android:id="#+id/blue"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/txt_material"
android:textColor="#color/white" />
<TextView
android:id="#+id/green"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/msg_enter_user_name"
android:textColor="#color/white" />
</LinearLayout>
</RelativeLayout>
In you layout using two properties that why it doesn't work. So you can remove one properties here is your working code
<RelativeLayout
android:id="#+id/scrollViewAndStuff"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/linear_layout_header">
<ScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp">
<TextView
android:textColor="#000"
android:id="#+id/meetupDescription"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:text="#string/text" />-
</ScrollView>
</RelativeLayout>
you can use this android:layout_below="#+id/linear_layout_header or this android:layout_above="#+id/ln_layout_footer, one property at a time. or simply copy and past