Scrolling not working in android xml layout? - android

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>

Related

RecycleView using view holder able to scroll inside

I have my container.xml :
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/toolbar"
android:id="#+id/techScrolView"
>
<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:orientation="horizontal"
android:layout_marginTop="15dp"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_marginLeft="30dp">
<FrameLayout
android:id="#+id/photo_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp">
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/profileDisplayImg"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:background="#drawable/circle"
android:gravity="center"
android:text="#string/hint_image"
android:textSize="#dimen/hint_size"
/>
</RelativeLayout>
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text="#string/edit_detail"
android:textColor="#color/white"
android:drawableLeft="#drawable/pencil"
android:id="#+id/edit_profile"
/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:id="#+id/profileName"
android:textColor="#color/white"
android:textSize="#dimen/profile_text_size"
android:padding="2dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_horizontal"
android:id="#+id/profilePlace"
android:padding="2dp"
android:textColor="#color/white"
android:textSize="#dimen/profile_text_size"
android:drawableRight="#drawable/map_marker_white"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="#color/white"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp"
android:padding="6dp"
android:layout_marginTop="10dp"
android:baselineAligned="false"
android:layoutDirection="rtl"
>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/social_media_circle"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/google_plus"
android:id="#+id/profileGoogle"
android:layout_marginRight="5dp"
android:layout_centerVertical="true"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/social_media_circle"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/facebook"
android:id="#+id/profileFace"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/social_media_circle"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:layout_gravity="left"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/white_phone"
android:id="#+id/profileCall"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="40dp"
android:layout_marginRight="20dp"
android:layout_marginTop="15dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layoutDirection="rtl">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/career"
android:textColor="#color/white"
android:textSize="#dimen/profile_text_size"
android:layout_gravity="center"
android:gravity="right"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/text_display_color"
android:textSize="#dimen/profile_info_text_size"
android:text=""
android:padding="3dp"
android:layout_gravity="center|left"
android:gravity="left"
android:layout_marginRight="80dp"
android:id="#+id/profileSkills"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layoutDirection="rtl"
android:layout_marginTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/years_experince"
android:textColor="#color/white"
android:textSize="#dimen/profile_text_size"
android:layout_gravity="center"
android:gravity="right"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/text_display_color"
android:layout_gravity="center"
android:gravity="left"
android:layout_marginRight="18dp"
android:textSize="#dimen/profile_info_text_size"
android:text=""
android:padding="5dp"
android:id="#+id/profileExperince"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layoutDirection="rtl"
android:layout_marginTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/current_salary"
android:textColor="#color/white"
android:textSize="#dimen/profile_text_size"
android:layout_gravity="center"
android:gravity="right"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/text_display_color"
android:layout_gravity="center"
android:gravity="left"
android:layout_marginRight="48dp"
android:textSize="#dimen/profile_info_text_size"
android:text=""
android:padding="5dp"
android:id="#+id/profileSalary"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layoutDirection="rtl"
android:layout_marginTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/kafeel_type"
android:textColor="#color/white"
android:textSize="#dimen/profile_text_size"
android:layout_gravity="center"
android:gravity="right"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/text_display_color"
android:layout_gravity="center"
android:gravity="left"
android:layout_marginRight="45dp"
android:textSize="#dimen/profile_info_text_size"
android:text=""
android:padding="5dp"
android:id="#+id/profileKafeel"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layoutDirection="rtl"
android:layout_marginTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/nationalty"
android:textColor="#color/white"
android:textSize="#dimen/profile_text_size"
android:layout_gravity="center"
android:gravity="right"
/>
<TextView
android:id="#+id/profileNationalty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="78dp"
android:textColor="#color/text_display_color"
android:gravity="left"
android:padding="5dp"
android:text=""
android:textSize="#dimen/profile_info_text_size" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layoutDirection="rtl"
android:layout_marginTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/statuse"
android:textColor="#color/white"
android:textSize="#dimen/profile_text_size"
android:layout_gravity="center"
android:gravity="right"
/>
<TextView
android:id="#+id/profileStatue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="90dp"
android:gravity="left"
android:padding="5dp"
android:text=""
android:textColor="#color/text_display_color"
android:textSize="#dimen/profile_info_text_size" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layoutDirection="rtl"
android:layout_marginTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/drive"
android:textColor="#color/white"
android:textSize="#dimen/profile_text_size"
android:layout_gravity="center"
android:gravity="right"
/>
<TextView
android:id="#+id/profileDriveStatue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="45dp"
android:gravity="left"
android:padding="5dp"
android:text=""
android:textColor="#color/text_display_color"
android:textSize="#dimen/profile_info_text_size" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layoutDirection="rtl"
android:layout_marginTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/age"
android:textColor="#color/white"
android:textSize="#dimen/profile_text_size"
android:layout_gravity="center"
android:gravity="right"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/text_display_color"
android:layout_gravity="center"
android:gravity="left"
android:layout_marginRight="96dp"
android:textSize="#dimen/profile_info_text_size"
android:text=""
android:padding="5dp"
android:id="#+id/profileAge"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
and i displayed it inside my recycleView :
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.SwipeRefreshLayout
android:id="#+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="#+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"
android:paddingBottom="28dp" />
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>`
i displayed this content by depend on viewHolder and it;s worked fine
but i can't scroll inside the recycleView..
how i can scroll inside it ?
is that possibole?
If remove NestedScrollView from your container.xml is no working , may be add it to your recyclerView layout , here is my project if i want to scroll inside the recyclerView:
<android.support.v4.widget.NestedScrollView
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.github.mikephil.charting.charts.LineChart
android:id="#+id/lineChartDiastolic"
android:layout_width="match_parent"
android:layout_height="250dp"></com.github.mikephil.charting.charts.LineChart>
<TextView
android:id="#+id/lineChartSystolicTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="#string/systolic"
android:textColor="#android:color/black"
android:textSize="20dp" />
<com.github.mikephil.charting.charts.LineChart
android:id="#+id/lineChartSystolic"
android:layout_width="match_parent"
android:layout_height="250dp"></com.github.mikephil.charting.charts.LineChart>
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerForDataReportBloodPressure"
android:layout_width="match_parent"
android:layout_height="350dp"></android.support.v7.widget.RecyclerView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
In your case , remove NestedScrollView on container.xml , add it on recyclerView layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v4.widget.SwipeRefreshLayout
android:id="#+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="#+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"
android:paddingBottom="28dp" />
</android.support.v4.widget.SwipeRefreshLayout>
</android.support.v4.widget.NestedScrollView>
</LinearLayout>

Android WebView Rendering Issue after Android System Webview Update

I am facing Webview Rendering issue on Android devices after Android System WebView Update. Webview is rendering outside the screen. For more information, please check screenshot.
Does anyone have a same issue?
Any help will be appreciated.Thanks in advance.
Please see the xml file as asked:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/fragment_back_color">
<ScrollView
android:id="#+id/offerDetailScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:layout_above="#+id/installTextView">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp">
<android.support.v7.widget.CardView
android:id="#+id/card_offer"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/topViewDealDisplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingTop="10dp">
<ImageView
android:id="#+id/dealImageView"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_centerInParent="true"
android:layout_margin="5dp"></ImageView>
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/dealNameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="4dp"
android:text=""
android:textColor="#color/text_color"
android:textSize="18sp" />
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/offerTitleTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="4dp"
android:text="deal titile"
android:textColor="#color/lower_text_color"
android:textSize="18sp"
android:visibility="gone" />
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/offerTypeTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="2"
android:text=""
android:textColor="#color/lower_text_color"
android:textSize="14sp" />
</LinearLayout>
<FrameLayout
android:id="#+id/frameLayoutAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="20dp"
android:clickable="true"
android:focusable="true"
android:gravity="right">
<ImageView
android:id="#+id/iv_rupee_bg"
android:layout_width="70dp"
android:layout_height="30dp"
android:layout_marginRight="-15dp"
android:background="#drawable/deals_image_background" />
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/tv_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:paddingLeft="4dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff"
android:textSize="17sp" />
</FrameLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/cardview_descImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/card_offer"
android:layout_marginTop="10dp"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<ImageView
android:id="#+id/dealDescriptionImageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#null"
android:visibility="visible" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/cardview_shortDesc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/cardview_descImage"
android:layout_marginTop="10dp"
android:padding="5dp">
<WebView
android:id="#+id/shortDescWebView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible" />
</android.support.v7.widget.CardView>
<com.spiceladdoo.views.LatoBoldTextView
android:id="#+id/related_offer_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/cardview_shortDesc"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:text="SIMILAR OFFERS"
android:textColor="#color/text_color"
android:textSize="13sp" />
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerViewoffers"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_below="#id/related_offer_text"
android:layout_marginTop="10dp"
android:scrollbars="none" />
<ProgressBar
android:id="#+id/shortDescriptionProgress"
style="?android:attr/android:progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="visible" />
</RelativeLayout>
</ScrollView>
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/installTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_marginTop="5dp"
android:background="#color/newFreeBColor"
android:gravity="center"
android:paddingBottom="15dp"
android:paddingTop="15dp"
android:text="INSTALL"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold"
android:visibility="visible" />
<FrameLayout
android:id="#+id/hint"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/layoutInstallHint"
android:background="#99000000"></RelativeLayout>
<RelativeLayout
android:id="#+id/layoutInstallHint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:background="#99000000">
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/installTextHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginBottom="15dp"
android:layout_marginTop="5dp"
android:background="#color/spice_laddooblue"
android:paddingBottom="10dp"
android:paddingLeft="80dp"
android:paddingRight="80dp"
android:paddingTop="10dp"
android:text="INSTALL"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#FFFFFF"
android:textSize="15sp"
android:textStyle="bold"
android:visibility="visible" />
</RelativeLayout>
<com.spiceladdoo.views.LatoRegularTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/imageViewHintPinIcon"
android:layout_centerHorizontal="true"
android:text="Click on Button"
android:textColor="#color/white"
android:textSize="18sp" />
<ImageView
android:id="#+id/imageViewHintPinIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="50dp"
android:src="#drawable/hint_pin_down" />
</RelativeLayout>
</FrameLayout>
</RelativeLayout>
I think you have made mistake in giving webview's height you have given it as wrap_content instead try match_parent and give it try
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/fragment_back_color">
<ScrollView
android:id="#+id/offerDetailScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:layout_above="#+id/installTextView">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp">
<android.support.v7.widget.CardView
android:id="#+id/card_offer"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/topViewDealDisplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingTop="10dp">
<ImageView
android:id="#+id/dealImageView"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_centerInParent="true"
android:layout_margin="5dp"></ImageView>
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/dealNameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="4dp"
android:text=""
android:textColor="#color/text_color"
android:textSize="18sp" />
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/offerTitleTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="4dp"
android:text="deal titile"
android:textColor="#color/lower_text_color"
android:textSize="18sp"
android:visibility="gone" />
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/offerTypeTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="2"
android:text=""
android:textColor="#color/lower_text_color"
android:textSize="14sp" />
</LinearLayout>
<FrameLayout
android:id="#+id/frameLayoutAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="20dp"
android:clickable="true"
android:focusable="true"
android:gravity="right">
<ImageView
android:id="#+id/iv_rupee_bg"
android:layout_width="70dp"
android:layout_height="30dp"
android:layout_marginRight="-15dp"
android:background="#drawable/deals_image_background" />
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/tv_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:paddingLeft="4dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff"
android:textSize="17sp" />
</FrameLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/cardview_descImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/card_offer"
android:layout_marginTop="10dp"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<ImageView
android:id="#+id/dealDescriptionImageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#null"
android:visibility="visible" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/cardview_shortDesc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/cardview_descImage"
android:layout_marginTop="10dp"
android:padding="5dp">
<WebView
android:id="#+id/shortDescWebView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible" />
</android.support.v7.widget.CardView>
<com.spiceladdoo.views.LatoBoldTextView
android:id="#+id/related_offer_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/cardview_shortDesc"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:text="SIMILAR OFFERS"
android:textColor="#color/text_color"
android:textSize="13sp" />
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerViewoffers"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_below="#id/related_offer_text"
android:layout_marginTop="10dp"
android:scrollbars="none" />
<ProgressBar
android:id="#+id/shortDescriptionProgress"
style="?android:attr/android:progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="visible" />
</RelativeLayout>
</ScrollView>
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/installTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_marginTop="5dp"
android:background="#color/newFreeBColor"
android:gravity="center"
android:paddingBottom="15dp"
android:paddingTop="15dp"
android:text="INSTALL"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold"
android:visibility="visible" />
<FrameLayout
android:id="#+id/hint"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/layoutInstallHint"
android:background="#99000000"></RelativeLayout>
<RelativeLayout
android:id="#+id/layoutInstallHint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:background="#99000000">
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/installTextHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginBottom="15dp"
android:layout_marginTop="5dp"
android:background="#color/spice_laddooblue"
android:paddingBottom="10dp"
android:paddingLeft="80dp"
android:paddingRight="80dp"
android:paddingTop="10dp"
android:text="INSTALL"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#FFFFFF"
android:textSize="15sp"
android:textStyle="bold"
android:visibility="visible" />
</RelativeLayout>
<com.spiceladdoo.views.LatoRegularTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/imageViewHintPinIcon"
android:layout_centerHorizontal="true"
android:text="Click on Button"
android:textColor="#color/white"
android:textSize="18sp" />
<ImageView
android:id="#+id/imageViewHintPinIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="50dp"
android:src="#drawable/hint_pin_down" />
</RelativeLayout>
</FrameLayout>
</RelativeLayout>
or if this not work then you can put scrollview inside cardview and then webview in card view

How to set LinearLayout at center of it's parent RelativeLayout?

In my login page I have two LinearLayouts. The second Linear-layout I want to set at center of it's Parent Relative layout and another Linear layout I want to be set top|left of it's parent Relative- layout.
How can I achieve this?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/rootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/yellow">
<ScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="false">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:gravity="top"
android:layout_alignParentLeft="true"
android:orientation="vertical">
<TextView
android:id="#+id/user_name_text_view_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="#string/language_title"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/redcolor" />
<Spinner
android:id="#+id/spinnerList"
style="#style/spinner_style"
android:layout_width="85dp"
android:layout_height="wrap_content"
android:layout_marginTop="3dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
android:src="#drawable/ic_serba_logo_red" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/textmain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_margin="10dp"
android:orientation="vertical">
<EditText
android:id="#+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="#drawable/bordertextbox"
android:ems="10"
android:hint="#string/username_title"
android:inputType="textEmailAddress"
android:padding="8dp"
android:textColor="#android:color/white"
android:textColorHint="#android:color/white">
<requestFocus />
</EditText>
<EditText
android:id="#+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="7dp"
android:background="#drawable/bordertextbox"
android:ems="10"
android:hint="#string/password_title"
android:inputType="textPassword"
android:padding="8dp"
android:textColor="#android:color/white"
android:textColorHint="#android:color/white" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:weightSum="2">
<Button
android:id="#+id/registerButton"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginRight="7dp"
android:layout_weight="1"
android:background="#color/splahbgcolor"
android:text="#string/user_register_title"
android:textColor="#android:color/white" />
<Button
android:id="#+id/loginButton"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="7dp"
android:layout_weight="1"
android:background="#color/splahbgcolor"
android:text="#string/user_login__title"
android:textColor="#android:color/white" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
You just need to change 2 things :
android:fillViewport="true" //for scrollView
and for your RelativeLayout height should be match_parent
android:layout_height="match_parent"
use android:layout_centerInParent="true" for LinearLayout when its parent is Relative layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/rootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/yellow">
<ScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="false">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:gravity="top"
android:layout_alignParentLeft="true"
android:orientation="vertical">
<TextView
android:id="#+id/user_name_text_view_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="#string/language_title"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/redcolor" />
<Spinner
android:id="#+id/spinnerList"
style="#style/spinner_style"
android:layout_width="85dp"
android:layout_height="wrap_content"
android:layout_marginTop="3dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
android:src="#drawable/ic_serba_logo_red" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/textmain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_margin="10dp"
android:orientation="vertical">
<EditText
android:id="#+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="#drawable/bordertextbox"
android:ems="10"
android:hint="#string/username_title"
android:inputType="textEmailAddress"
android:padding="8dp"
android:textColor="#android:color/white"
android:textColorHint="#android:color/white">
<requestFocus />
</EditText>
<EditText
android:id="#+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="7dp"
android:background="#drawable/bordertextbox"
android:ems="10"
android:hint="#string/password_title"
android:inputType="textPassword"
android:padding="8dp"
android:textColor="#android:color/white"
android:textColorHint="#android:color/white" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:weightSum="2">
<Button
android:id="#+id/registerButton"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginRight="7dp"
android:layout_weight="1"
android:background="#color/splahbgcolor"
android:text="#string/user_register_title"
android:textColor="#android:color/white" />
<Button
android:id="#+id/loginButton"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="7dp"
android:layout_weight="1"
android:background="#color/splahbgcolor"
android:text="#string/user_login__title"
android:textColor="#android:color/white" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
I have Change your code Just try it. i think its work well
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/rootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/background_light">
<ScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:gravity="top"
android:layout_alignParentLeft="true"
android:orientation="vertical">
<TextView
android:id="#+id/user_name_text_view_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="title"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/holo_red_dark" />
<Spinner>
android:id="#+id/spinnerList"
style="#"
android:layout_width="85dp"
android:layout_height="wrap_content"
android:layout_marginTop="3dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:src="#mipmap/ic_launcher" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/textmain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_margin="10dp"
android:orientation="vertical">
<EditText
android:id="#+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="#android:color/holo_blue_light"
android:ems="10"
android:hint="username"
android:inputType="textEmailAddress"
android:padding="8dp"
android:textColor="#android:color/white"
android:textColorHint="#android:color/white">
<requestFocus />
</EditText>
<EditText
android:id="#+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="7dp"
android:background="#android:color/holo_blue_light"
android:ems="10"
android:hint="password"
android:inputType="textPassword"
android:padding="8dp"
android:textColor="#android:color/white"
android:textColorHint="#android:color/white" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:weightSum="2">
<Button
android:id="#+id/registerButton"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginRight="7dp"
android:layout_weight="1"
android:background="#color/BlueColor"
android:text="register"
android:textColor="#android:color/white" />
<Button
android:id="#+id/loginButton"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="7dp"
android:layout_weight="1"
android:background="#1FFBBD"
android:text="Login"
android:textColor="#android:color/white" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</ScrollView>

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>

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

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">

Categories

Resources