ScrollView Not Working(It's Not Scrolling the layout) - android

I am new to Android and working on a App and stuck here on ScrollView. I have tried width and height "match parent" but still not working. I am posting my code. I have wasted more than an hour on this. Thanks in advance.
Here is my XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1"
android:orientation="vertical">
<LinearLayout
android:id="#+id/linear_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.02"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="20dp"
android:text="Marketing"
android:textColor="#color/black"
android:textSize="25dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/linear_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/linear_header"
android:layout_weight="0.02"
android:background="#color/light_blue"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="15dp"
android:text="Register Here"
android:textColor="#color/white"
android:textSize="22dp"
android:textStyle="bold" />
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/linear_register"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:layout_weight="0.04"
android:orientation="vertical">
<EditText
android:id="#+id/edit_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Name*"
android:inputType="text" />
<EditText
android:id="#+id/edit_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="Email*"
android:inputType="text" />
<EditText
android:id="#+id/edit_pswd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="Password*"
android:inputType="text" />
<EditText
android:id="#+id/edit_cnfrm_pswd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="Confirm Password*"
android:inputType="text" />
<Button
android:id="#+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginTop="20dp"
android:background="#drawable/button_bg"
android:padding="15dp"
android:text="Register"
android:textStyle="bold" />
<TextView
android:id="#+id/txt_forgot_pswd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="Forgot/Reset Password"
android:textColor="#color/light_blue" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:weightSum="1"
android:layout_marginBottom="10dp"
android:orientation="horizontal">
<Button
android:id="#+id/btn_google"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="GOOGLE"
android:textColor="#color/white"
android:textStyle="bold"
android:textSize="15sp"
android:layout_marginRight="5dp"
android:background="#color/red"
android:layout_weight="0.5"/>
<Button
android:id="#+id/btn_facebook"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="FACEBOOK"
android:textColor="#color/white"
android:background="#color/fb_blue"
android:layout_marginLeft="5dp"
android:textStyle="bold"
android:textSize="15sp"
android:layout_weight="0.5"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>

set lay out weight to scroll view like
<ScrollView
android:layout_weight="0.96"
android:layout_width="match_parent"
android:layout_height="wrap_content">

Related

ListView is not aligned even after added layout_weight

Here is the output of my code. I cannot get all views aligned in each ListView item. I already used layout_weight for each view and also set the layout_width to 0sp. Really curious about why it cannot work. Hope to get some solutions. Thank you!
list_item.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="95sp">
<ImageView
android:id="#+id/image"
android:layout_width="0dp"
android:layout_height="match_parent"
android:src="#drawable/download"
android:layout_weight="1"
android:layout_marginLeft="12sp"
android:scaleType="fitCenter"
android:adjustViewBounds="false"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:orientation="vertical"
android:layout_marginLeft="12sp">
<TextView
android:id="#+id/name"
android:text="name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textSize="20sp"/>
<TextView
android:id="#+id/new_age"
android:text="New Age"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"/>
<TextView
android:id="#+id/email"
android:text="Email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"/>
<TextView
android:id="#+id/phone"
android:text="Phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"/>
</LinearLayout>
<TextView
android:id="#+id/countdown"
android:text="Tomorrow"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:layout_marginTop="16sp"
android:textSize="16sp"/>
...
</LinearLayout>
Use this :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="95dp"
android:weightSum="4"
android:orientation="horizontal">
<ImageView
android:id="#+id/image"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="12sp"
android:layout_weight="1"
android:adjustViewBounds="false"
android:scaleType="fitCenter"
android:src="#mipmap/ic_launcher" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="12sp"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:id="#+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="name"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/new_age"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="New Age"
android:textSize="16sp" />
<TextView
android:id="#+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Email"
android:textSize="16sp" />
<TextView
android:id="#+id/phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Phone"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content">
<TextView
android:id="#+id/countdown"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16sp"
android:gravity="center"
android:text="Tomorrow"
android:textSize="16sp" />
<TextView
android:id="#+id/daysago"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16sp"
android:gravity="center"
android:text="4days ago"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
You need to add layout_weightSum in your parent layout -
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="95dp"
android:weightSum="4"
android:orientation="horizontal">
<ImageView
android:id="#+id/image"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="12sp"
android:layout_weight="1"
android:adjustViewBounds="false"
android:scaleType="fitXY" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="12sp"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:id="#+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="name"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/new_age"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="New Age"
android:textSize="16sp" />
<TextView
android:id="#+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Email"
android:textSize="16sp" />
<TextView
android:id="#+id/phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Phone"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content">
<TextView
android:id="#+id/countdown"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16sp"
android:gravity="center"
tools:text="Tomorrow"
android:textSize="16sp" />
<TextView
android:id="#+id/daysago"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16sp"
android:gravity="center"
tools:text="4 days ago"
android:textSize="16sp" />
</LinearLayout>
You need to then equally distribute the weight by using android:layout_weight="1" on each of the child layouts.
Let me know if you need more help.

Keyboard covers my textarea android

I have a text area like this
When i try to write in the last section, at the bottom, the keyboard covers all of this.
EDIT: This is my layout. The problem is in the linearlayout with id: layout_notas
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/activity_crear_entrenamiento"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="#+id/tool_bar"
layout="#layout/toolbar"></include>
<LinearLayout
android:id="#+id/layout_ejercicios"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_below="#+id/layout_info"
android:layout_alignParentStart="true">
<TextView
android:text="Ejercicios"
android:textStyle="bold"
android:textSize="30dp"
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/ejercicios"
android:background="#color/colorPrimary"
android:layout_marginTop="0dp"
android:layout_below="#+id/tool_bar"
android:layout_alignParentStart="true" />
</LinearLayout>
<LinearLayout
android:id="#+id/layout_notas"
android:layout_below="#+id/layout_ejercicios"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:orientation="vertical">
<TextView
android:text="Notas"
android:textSize="30dp"
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/notas"
android:background="#color/colorPrimary"
android:layout_marginTop="0dp"
android:layout_below="#+id/tool_bar"
android:layout_alignParentStart="true" />
<EditText
android:id="#+id/textArea_information"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#null"
android:gravity="top|left"
android:inputType="textMultiLine"
android:overScrollMode="always"
android:scrollbarStyle="insideInset"
android:scrollbars="vertical"
android:lines="6"
android:textAppearance="?android:attr/textAppearanceMedium"
android:scrollHorizontally="false" />
</LinearLayout>
<LinearLayout
android:id="#+id/layout_info"
android:layout_width="wrap_content"
android:layout_height="65dp"
android:orientation="horizontal"
android:layout_below="#+id/tool_bar"
android:layout_alignParentStart="true">
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableRow>
<TextView
android:text="Hora inicio:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/tvHoraInicio"
android:textSize="25dp"
android:layout_weight="1" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="time"
android:ems="3"
android:maxLength="5"
android:textSize="25dp"
android:id="#+id/etHoraInicio"
android:layout_weight="1"
android:layout_toRightOf="#+id/tvHoraInicio"/>
<TextView
android:text="Ubicacion:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/tvUbicacion"
android:textSize="25dp"
android:paddingLeft="50dp"
android:layout_weight="1" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="text"
android:ems="7"
android:textSize="25dp"
android:maxLength="20"
android:id="#+id/etUbicacion"
android:layout_weight="1"
android:layout_toRightOf="#+id/tvUbicacion"/>
</TableRow>
</TableLayout>
</LinearLayout>
</RelativeLayout>
How can i solve it?

Scrolling not working in android xml layout?

I am getting problem to make this layout scroll it is not scrolling. I have also used the Scrollview in this. I am not able to detect why it is not working. This is a login screen with Social Login buttons at the bottom of the screen. but it is not working.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/mail_login"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#mipmap/login_bg_img"
android:isScrollContainer="true">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:isScrollContainer="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:isScrollContainer="true">
<TextView
android:id="#+id/txt_heading"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="15dp"
android:background="#null"
android:gravity="center"
android:text="Sign In"
android:textColor="#ffffff"
android:textSize="#dimen/Login_signinText" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="55dp"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:src="#mipmap/login_logo_icon" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#mipmap/login_input_bar1"
android:gravity="left|center_vertical"
android:orientation="vertical">
<EditText
android:id="#+id/et_email_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#null"
android:hint="Username"
android:maxLength="20"
android:maxLines="1"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:singleLine="true"
android:textColor="#777e86"
android:textColorHint="#777e86"
android:textSize="#dimen/Login_username" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/ll_singup_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#mipmap/login_input_bar2"
android:gravity="left|center_vertical"
android:orientation="vertical">
<EditText
android:id="#+id/et_password_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#null"
android:hint="Password"
android:inputType="textPassword"
android:maxLength="15"
android:maxLines="1"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:singleLine="true"
android:textColor="#777e86"
android:textColorHint="#777e86"
android:textSize="#dimen/Login_username" />
</LinearLayout>
<TextView
android:id="#+id/txt_forget_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginTop="5dp"
android:text="Forgot Password?"
android:textColor="#ffffff"
android:textSize="#dimen/Login_forgotpassword" />
<TextView
android:id="#+id/txt_sign_up"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginTop="30dp"
android:gravity="center"
android:text="Forget Password"
android:textColor="#ffffff"
android:textSize="#dimen/Login_forgotpassword" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/login_btn"
style="?android:borderlessButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#mipmap/login_btn" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Let me in"
android:textColor="#fff"
android:textSize="18sp" />
</RelativeLayout>
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:orientation="vertical"-->
<!--android:gravity="center"-->
<!--android:layout_marginTop="15dp"-->
<!--android:paddingBottom="10dp"-->
<!--android:layout_alignParentBottom="true">-->
<!--<TextView-->
<!--android:id="#+id/forgot_login"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:paddingBottom="8dp"-->
<!--android:paddingRight="5dp"-->
<!--android:text="Forgot Password ?"-->
<!--android:textSize="18sp"-->
<!--android:textColor="#fff"/>-->
<!--</LinearLayout>-->
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:orientation="vertical"-->
<!--android:gravity="center"-->
<!--android:layout_marginTop="25dp"-->
<!--android:paddingBottom="10dp"-->
<!--android:layout_alignParentBottom="true">-->
<!--<TextView-->
<!--android:id="#+id/Sign_up"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:paddingBottom="8dp"-->
<!--android:paddingRight="5dp"-->
<!--android:text="Don't have an account? Sign Up"-->
<!--android:textSize="18sp"-->
<!--android:textColor="#fff"/>-->
<!--</LinearLayout>-->
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="30dp"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:id="#+id/ll_fb"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#mipmap/login_facebook_btn"
android:orientation="horizontal">
</LinearLayout>
<LinearLayout
android:id="#+id/ll_google"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#mipmap/login_google_btn"
android:orientation="horizontal">
</LinearLayout>
<LinearLayout
android:id="#+id/ll_twitter"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#mipmap/login_twitter_btn"
android:orientation="horizontal">
</LinearLayout>
</LinearLayout>
Try to work like that
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/llbottom"
android:layout_alignParentTop="true"
>
and take id to your bottom id
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="30dp"
android:orientation="horizontal"
android:id="#+id/llbottom"
android:weightSum="3">
close the tag at the end.</RelativeLayout>
Try adding this attribute to your scrollviewer:
android:fillViewport="true"
You use this.`
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/mail_login"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#mipmap/ic_launcher"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="120dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:isScrollContainer="true">
<TextView
android:id="#+id/txt_heading"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="15dp"
android:background="#null"
android:gravity="center"
android:text="Sign In"
android:textColor="#ffffff"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="55dp"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:src="#mipmap/ic_launcher" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#mipmap/ic_launcher"
android:gravity="left|center_vertical"
android:orientation="vertical">
<EditText
android:id="#+id/et_email_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#null"
android:hint="Username"
android:maxLength="20"
android:maxLines="1"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:singleLine="true"
android:textColor="#777e86"
android:textColorHint="#777e86"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/ll_singup_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#mipmap/ic_launcher"
android:gravity="left|center_vertical"
android:orientation="vertical">
<EditText
android:id="#+id/et_password_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#null"
android:hint="Password"
android:inputType="textPassword"
android:maxLength="15"
android:maxLines="1"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:singleLine="true"
android:textColor="#777e86"
android:textColorHint="#777e86"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="#+id/txt_forget_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginTop="5dp"
android:text="Forgot Password?"
android:textColor="#ffffff"
android:textSize="12sp" />
<TextView
android:id="#+id/txt_sign_up"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginTop="30dp"
android:gravity="center"
android:text="Forget Password"
android:textColor="#ffffff"
android:textSize="12sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/login_btn"
style="?android:borderlessButtonStyle"
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:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Let me in"
android:textColor="#fff"
android:textSize="18sp" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="30dp"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:id="#+id/ll_fb"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#mipmap/ic_launcher"
android:orientation="horizontal">
</LinearLayout>
</LinearLayout>
</RelativeLayout>

The layout in red color Layout is not visible over the silver one

The layout in red color Layout is not visible over the silver one. I would like to overlap the container and make visible the textview visible in above container.
Please suggest what should be the solution as marginTop=-30dp seems to work bad. Any help would be appriciated.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#676363"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="#string/special_offer"
android:id="#+id/special_offer"
android:textStyle="bold"
android:textSize="25dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textColor="#f0eaea" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="#string/disney_less"
android:id="#+id/disney_less"
android:textStyle="bold"
android:textSize="20dp"
android:layout_below="#+id/special_offer"
android:layout_centerHorizontal="true"
android:textColor="#ef6e6e"
android:shadowColor="#ffffff" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/choose_disney"
android:id="#+id/choose_disney"
android:textSize="15dp"
android:textColor="#eef7e3"
android:textStyle="bold"
android:layout_below="#+id/disney_less"
android:layout_centerHorizontal="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/take_advantage"
android:id="#+id/take_advantage"
android:layout_gravity="center_horizontal"
android:textColor="#191717"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="false"
android:paddingStart="10dp"
android:paddingEnd="5dp"
android:gravity="bottom"
android:layout_alignParentEnd="false" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="vertical"
android:background="#efefef"
>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="#string/disney_world"
android:id="#+id/disney_world"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:textStyle="bold"
android:textSize="30dp"
android:fontFamily="#string/common_google_play_services_enable_text"
android:textColor="#0b125f" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:orientation="vertical"
android:background="#efefef"
>
<RelativeLayout
android:layout_height="320dp"
android:layout_width="match_parent">
<FrameLayout android:layout_height="160dp"
android:layout_width="match_parent"
android:background="#a9a9a9"
>
</FrameLayout>
<LinearLayout
android:layout_height="160dp"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_marginTop="160dp"
android:background="#e4e4e4"
>
<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#a26262"
android:layout_marginTop="-30dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/save_upto"
android:id="#+id/save_upto"
android:textStyle="bold"
android:textColor="#1c234a"
android:textSize="20dp"
android:layout_gravity="center"
android:layout_marginTop="5dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/room_selected"
android:text="#string/room_selected"
android:textSize="12dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:layout_gravity="center"
android:layout_marginBottom="7dp"
android:layout_marginTop="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/great_rate"
android:text="#string/great_rate"
android:textSize="12dp"
android:paddingLeft="35dp"
android:paddingRight="35dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout android:layout_height="match_parent"
android:layout_width="match_parent"
android:background="#a3d5d1ef"
android:backgroundTintMode="screen"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/more_information"
android:id="#+id/more_information"
android:textColor="#1c234a"
android:textSize="16dp"
android:layout_marginTop="5dp"
android:layout_gravity="center" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/special_saving"
android:id="#+id/special_saving"
android:textColor="#040404"
android:textSize="16dp"
android:textStyle="bold"
android:layout_marginTop="5dp"
android:layout_gravity="center"
android:layout_marginBottom="5dp"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
So I went ahead and tried to view your code by putting it in Android Studio and I got this:
The red layout is under the silver layout, which makes the save up to textview not visible. And by your description -- I would like to overlap the container and make visible the textview visible in above container. -- you want the layout with silver background to be on top of the red layout, where it shows the TextView with Save Up to, and if what I imagine it would like is correct, it would be something like this:
Here is the modified code:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#676363">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp">
<TextView
android:id="#+id/special_offer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:text="Special Offer"
android:textColor="#f0eaea"
android:textSize="25dp"
android:textStyle="bold" />
<TextView
android:id="#+id/disney_less"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/special_offer"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:shadowColor="#ffffff"
android:text="Disney Less"
android:textColor="#ef6e6e"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="#+id/choose_disney"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/disney_less"
android:layout_centerHorizontal="true"
android:text="Choose Disney"
android:textColor="#eef7e3"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/take_advantage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="false"
android:layout_alignParentLeft="false"
android:layout_alignParentRight="false"
android:layout_gravity="center_horizontal"
android:gravity="bottom"
android:paddingEnd="5dp"
android:paddingLeft="10dp"
android:paddingRight="5dp"
android:paddingStart="10dp"
android:text="Take Advantage"
android:textColor="#191717" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="#efefef"
android:orientation="vertical"
>
<TextView
android:id="#+id/disney_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="Disney World"
android:textColor="#0b125f"
android:textSize="30dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="#efefef"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="320dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="160dp"
android:background="#a9a9a9" />
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="160dp"-->
<!--android:layout_marginTop="160dp"-->
<!--android:background="#e4e4e4"-->
<!--android:orientation="vertical">-->
<!--</LinearLayout>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="30dp"
android:background="#a26262"
android:orientation="vertical">
<TextView
android:id="#+id/save_upto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="Save Up to"
android:textColor="#1c234a"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="#+id/room_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="7dp"
android:layout_marginTop="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="Room Selected"
android:textSize="12dp" />
<TextView
android:id="#+id/great_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="35dp"
android:paddingRight="35dp"
android:text="Great Rate"
android:textSize="12dp" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#a3d5d1ef"
android:backgroundTintMode="screen"
android:orientation="vertical">
<TextView
android:id="#+id/more_information"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="More Info"
android:textColor="#1c234a"
android:textSize="16dp" />
<TextView
android:id="#+id/special_saving"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:text="Special Saving"
android:textColor="#040404"
android:textSize="16dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
Hope this helps, if ever this is not the full answer you are looking for, feel free to comment and I'll try to help as much as I can. :)
Akshat try this
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#676363">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp">
<TextView
android:id="#+id/special_offer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:text="special_offer"
android:textColor="#f0eaea"
android:textSize="25dp"
android:textStyle="bold" />
<TextView
android:id="#+id/disney_less"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/special_offer"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:shadowColor="#ffffff"
android:text="disney_less"
android:textColor="#ef6e6e"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="#+id/choose_disney"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/disney_less"
android:layout_centerHorizontal="true"
android:text="choose_disney"
android:textColor="#eef7e3"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/take_advantage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="false"
android:layout_alignParentLeft="false"
android:layout_gravity="center_horizontal"
android:gravity="bottom"
android:paddingEnd="5dp"
android:paddingStart="10dp"
android:text="ake_advantage"
android:textColor="#191717" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="#efefef"
android:orientation="vertical"
>
<TextView
android:id="#+id/disney_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="asasdsa"
android:textColor="#0b125f"
android:textSize="30dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="#efefef"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="320dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="160dp"
android:background="#a9a9a9">
</FrameLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_alignParentBottom="true"
android:background="#e4e4e4"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#a26262"
android:orientation="vertical">
<TextView
android:id="#+id/save_upto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="ave_upto"
android:textColor="#1c234a"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="#+id/room_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="7dp"
android:layout_marginTop="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="room_selected"
android:textSize="12dp" />
<TextView
android:id="#+id/great_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="35dp"
android:paddingRight="35dp"
android:text="great_rate"
android:textSize="12dp" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#a3d5d1ef"
android:backgroundTintMode="screen"
android:orientation="vertical">
<TextView
android:id="#+id/more_information"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="safsadf"
android:textColor="#1c234a"
android:textSize="16dp" />
<TextView
android:id="#+id/special_saving"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:text="asdg"
android:textColor="#040404"
android:textSize="16dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
Simply use RelativeLayout or FrameLayout. The last child view will overlay everything else.
FrameLayout is some kind of view stack. Made for special cases.
RelativeLayout is pretty powerful. You can define rules like View A has to align parent layout bottom, View B has to align A bottom to top, etc
As for your question.
In the LinearLayout that follows the FrameLayout remove the background attribute as its width is match_parent as it will cover the FrameLayout and also reduce the layout_marginTop to 130dp to get he desired effect of layout_marginTop=-30dp and remove the layout_marginTop=-30dp from the below LinearLayout.
which gives you the following
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#676363">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp">
<TextView
android:id="#+id/special_offer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:text="#string/special_offer"
android:textColor="#f0eaea"
android:textSize="25dp"
android:textStyle="bold" />
<TextView
android:id="#+id/disney_less"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/special_offer"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:shadowColor="#ffffff"
android:text="#string/disney_less"
android:textColor="#ef6e6e"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="#+id/choose_disney"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/disney_less"
android:layout_centerHorizontal="true"
android:text="#string/choose_disney"
android:textColor="#eef7e3"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/take_advantage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="false"
android:layout_alignParentLeft="false"
android:layout_gravity="center_horizontal"
android:gravity="bottom"
android:paddingEnd="5dp"
android:paddingStart="10dp"
android:text="#string/take_advantage"
android:textColor="#191717" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="#efefef"
android:orientation="vertical">
<TextView
android:id="#+id/disney_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:fontFamily="#string/common_google_play_services_enable_text"
android:text="#string/disney_world"
android:textColor="#0b125f"
android:textSize="30dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="#efefef"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="320dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="160dp"
android:background="#a9a9a9">
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_marginTop="130dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#a26262"
android:orientation="vertical">
<TextView
android:id="#+id/save_upto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="#string/save_upto"
android:textColor="#1c234a"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="#+id/room_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="7dp"
android:layout_marginTop="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="#string/room_selected"
android:textSize="12dp" />
<TextView
android:id="#+id/great_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="35dp"
android:paddingRight="35dp"
android:text="#string/great_rate"
android:textSize="12dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#a3d5d1ef"
android:backgroundTintMode="screen"
android:orientation="vertical">
<TextView
android:id="#+id/more_information"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="#string/more_information"
android:textColor="#1c234a"
android:textSize="16dp" />
<TextView
android:id="#+id/special_saving"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:text="#string/special_saving"
android:textColor="#040404"
android:textSize="16dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

Can't get to the bottom of the content with my scrollview

I have my xml file. It is a RelativeLayout with a ScrollView and inside the ScrollView I have LinearLayout and many more. The problem is that I can't reach the end of the view, as you can see it end with a "Sign Up" button... But my view is cut by the scroll and I can just see the middle of the button, the other middle is off screen.
So, any suggestions for how can I fix this? How can I work with the ScrollView so it wraps all of my content...
Check it:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/bg_signup"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".SignUp">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:background="#xml/signup_round">
<LinearLayout
android:layout_width="260dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#xml/border_lines"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/new_signup" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:text="#string/signup"
android:textColor="#color/colorRB"
android:textSize="26sp"
android:textStyle="bold" />
</LinearLayout>
<EditText
android:id="#+id/first_name_EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:layout_marginTop="-25dp"
android:hint="#string/first_name"
android:textColor="#color/colorRB" />
<EditText
android:id="#+id/last_name_EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:hint="#string/last_name"
android:textColor="#color/colorRB" />
<EditText
android:id="#+id/email_EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:hint="#string/email"
android:inputType="textEmailAddress"
android:textColor="#color/colorRB" />
<EditText
android:id="#+id/email_confirmation_EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:hint="#string/email_confirmation"
android:inputType="textEmailAddress"
android:textColor="#color/colorRB" />
<EditText
android:id="#+id/password_EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:hint="#string/password"
android:inputType="textPassword"
android:textColor="#color/colorRB" />
<EditText
android:id="#+id/password_confirmation_EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:hint="#string/password_confirmation"
android:inputType="textPassword"
android:textColor="#color/colorRB" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#xml/border_lines"
android:text="#string/sex"
android:textColor="#color/colorRB"
android:textSize="26sp"
android:textStyle="bold" />
<Spinner
android:id="#+id/sex_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-25dp"
android:entries="#array/sex_array" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#xml/border_lines"
android:text="#string/brithday"
android:textColor="#color/colorRB"
android:textSize="26sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-35dp"
android:orientation="horizontal">
<Button
android:id="#+id/birthdayBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="#color/fbutton_color_transparent"
android:onClick="showDatePickerDialog"
android:text="#string/birthdayBtn"
android:textAllCaps="false"
android:textColor="#color/colorRB" />
<Space
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="#+id/dateSelectedTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="--/--/--"
android:textColor="#color/colorRB"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingBottom="5dp"
android:text="#string/terms_conditions"
android:textColor="#color/colorRB"
android:textStyle="bold" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0" />
</LinearLayout>
<Button
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:background="#xml/button_round"
android:onClick=""
android:text="#string/signup"
android:textColor="#color/white"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick=""
android:src="#drawable/close_signup" />
</RelativeLayout>

Categories

Resources