How to set toolbar to fit to activity In android - android

I am trying to add toolbar to activity but it scrolls if i am scrolling
following is the code i have tried
I need to no scroll to toolbar only contains i want to scroll. I want to design like this image how to design form like below image
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:id="#+id/CoordinatorLayout_login"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:fillViewport="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center"
android:orientation="vertical">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbarforprofile"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:titleTextColor="#ffffff" />
<LinearLayout
android:id="#+id/profile_details"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="#+id/txtservicedetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="#string/app_name"
android:textColor="#color/colorAccent"
android:textSize="20sp"
android:textStyle="bold" />
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_requirement"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/editTextrequirement"
android:layout_width="match_parent"
android:layout_height="100dp"
android:hint="Your requirement?"
android:inputType="textMultiLine|textCapSentences"
android:maxLines="4"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_dateofvisit"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_dateofvisit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:hint="Date Of Visit"
android:inputType="date"
android:maxLines="1"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_fortime"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:hint="Time Of Visit"
android:inputType="time"
android:maxLines="1"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_noofperson"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_noofperson"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Number Of Person You Need"
android:inputType="number"
android:maxLines="1"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_serviceadd"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_serviceadd"
android:layout_width="match_parent"
android:layout_height="100dp"
android:hint="Service Address"
android:inputType="textMultiLine|textCapSentences"
android:maxLength="2000"
android:maxLines="4"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="#+id/btn_submit"
style="#style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Submit"
android:textSize="20dp"
android:textStyle="bold" />
<ProgressBar
android:id="#+id/btnsubmit"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
<!--
<ImageView
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="4dp"
android:adjustViewBounds="true"
android:fitsSystemWindows="true"
android:scaleType="fitXY"
android:src="#drawable/logo" />
-->
<!-- <android.support.v7.widget.CardView
android:id="#+id/card_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:elevation="0dp"
app:cardBackgroundColor="#android:color/white"
app:cardElevation="4dp"
card_view:cardCornerRadius="2dp"
card_view:cardUseCompatPadding="true">-->
<!-- </android.support.v7.widget.CardView>-->
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
[1]: https://i.stack.imgur.com/8tlhv.png

try this it will help you.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:id="#+id/CoordinatorLayout_login"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/MyDarkToolbarStyle">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimary"
android:gravity="end"
android:orientation="horizontal"
android:weightSum="8">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="8"
android:background="#color/colorPrimary"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="8">
<TextView
android:id="#+id/txt_header"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="8"
android:gravity="left"
android:text="Project Edit"
android:textColor="#color/white"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbarforprofile"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:titleTextColor="#ffffff" />
<LinearLayout
android:id="#+id/profile_details"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="#+id/txtservicedetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="#string/app_name"
android:textColor="#color/colorAccent"
android:textSize="20sp"
android:textStyle="bold" />
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_requirement"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/editTextrequirement"
android:layout_width="match_parent"
android:layout_height="100dp"
android:hint="Your requirement?"
android:inputType="textMultiLine|textCapSentences"
android:maxLines="4"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_dateofvisit"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_dateofvisit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:hint="Date Of Visit"
android:inputType="date"
android:maxLines="1"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_fortime"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:hint="Time Of Visit"
android:inputType="time"
android:maxLines="1"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_noofperson"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_noofperson"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Number Of Person You Need"
android:inputType="number"
android:maxLines="1"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_serviceadd"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_serviceadd"
android:layout_width="match_parent"
android:layout_height="100dp"
android:hint="Service Address"
android:inputType="textMultiLine|textCapSentences"
android:maxLength="2000"
android:maxLines="4"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="#+id/btn_submit"
style="#style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Submit"
android:textSize="20dp"
android:textStyle="bold" />
<ProgressBar
android:id="#+id/btnsubmit"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
<!--
<ImageView
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="4dp"
android:adjustViewBounds="true"
android:fitsSystemWindows="true"
android:scaleType="fitXY"
android:src="#drawable/logo" />
-->
<!-- <android.support.v7.widget.CardView
android:id="#+id/card_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:elevation="0dp"
app:cardBackgroundColor="#android:color/white"
app:cardElevation="4dp"
card_view:cardCornerRadius="2dp"
card_view:cardUseCompatPadding="true">-->
<!-- </android.support.v7.widget.CardView>-->
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>

layout design following this.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/MyDarkToolbarStyle">
// Do ur custom app bar
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimary"
android:gravity="end"
android:orientation="horizontal"
android:weightSum="8">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="8"
android:background="#color/colorPrimary"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="8">
<TextView
android:id="#+id/txt_header"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="8"
android:gravity="left"
android:text="Project Edit"
android:textColor="#color/white"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<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">
// add ur design
</LinearLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>
manifest file add this theme
android:theme="#style/AppTheme.NoActionBar"

Related

Toolbar not found in larger screen using fragment

I have a problem with my app whenever it is on a larger screen. i am using fragment and whenever i run the app on a smaller screen (5.2 inches) the toolbar shows and i can use the nav bar. but when i run it on a bigger screen (5.5 inches) it suddenly takes the whole screen with the toolbar nowhere to be found.
Smaller Screen:
Bigger Screen
Layout file for app_bar_drawer:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.jjcadiz.omas.Drawer">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="#layout/content_drawer" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="#dimen/fab_margin"
app:srcCompat="#android:drawable/ic_dialog_email" />
<android.support.v4.widget.DrawerLayout
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:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:theme="#style/MyMaterialTheme"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:text="Purchase Order"
/>
</android.support.v7.widget.Toolbar>
<FrameLayout
android:id="#+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/toolbar">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:weightSum="1"
android:background="#color/BG_beige">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="5dp">
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Purchase Order"
android:textColor="#color/omas_blue"
android:layout_gravity="center"
android:textSize="25sp"
android:gravity="center"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="41dp"
android:orientation="horizontal">
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Supplier Name:" />
<Spinner
android:id="#+id/SupplierSpinner"
android:layout_width="222dp"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Date of Transac" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.61"
android:text="TextView" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="55dp"
android:orientation="horizontal"
android:paddingTop="10dp">
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Item name"
android:gravity="center"
android:layout_gravity="center"/>
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Quantity"
android:gravity="center"
android:layout_gravity="center"/>
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Unit Price"
android:gravity="center"
android:layout_gravity="center"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="266dp"
android:orientation="horizontal">
<EditText
android:id="#+id/edtName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="textPersonName"
android:hint="Unit Name"/>
<EditText
android:id="#+id/edtQuantity"
android:layout_width="117dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:hint="Quantity" />
<EditText
android:id="#+id/edtPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="numberDecimal"
android:hint="Price"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="39dp"
android:orientation="horizontal">
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.99"
android:text="Total" />
<TextView
android:id="#+id/tvTotal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="PPP" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="#+id/textView13"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Prepared By:" />
<TextView
android:id="#+id/tvName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<Button
android:id="#+id/btnConfirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Confirm" />
<Button
android:id="#+id/btnReset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Reset" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</FrameLayout>
</RelativeLayout>
Use this xml in your layout it will work.

Scroll view making the reason to crash

My application getting crash by throughing below errors for scrollview, even childs are grouped in parent view. this is happening only when internet is off, otherwise it's working.
02-22 14:26:20.504 13277-13277/com.eonelectric.eon E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.eonelectric.eon, PID: 13277
java.lang.IllegalStateException: ScrollView can host only one direct child
at android.widget.ScrollView.addView(ScrollView.java:248)
at android.support.design.widget.Snackbar.showView(Snackbar.java:483)
at android.support.design.widget.Snackbar$1.handleMessage(Snackbar.java:167)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
My layout file is here.
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:fillViewport="true">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/main_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="#+id/loginBackgroundIv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="#drawable/login_bg"
tools:ignore="ContentDescription"/>
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/profilePicIv"
android:layout_width="135dp"
android:layout_height="110dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:scaleType="centerCrop"
android:src="#drawable/user"
app:civ_border_color="#fff"
app:civ_border_width="2dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="130dp"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:id="#+id/nameWraper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/nameEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:singleLine="true"
android:textColor="#ffffff" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/phoneWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/phoneEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:maxLength="10"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/emailWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/emailEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:id="#+id/pwdLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:id="#+id/pwdwrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/pwdEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textWebPassword"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/repwdwrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/repwdEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textWebPassword"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<!--<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="100">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="40"
android:padding="8dp"
android:text="User type ?"
android:textColor="#android:color/white"
android:textSize="16sp" />
<Spinner
android:id="#+id/userTypeSpinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="60"
android:entries="#array/userTypeArray" />
</LinearLayout>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="100">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="40"
android:padding="8dp"
android:text="State ?"
android:textColor="#android:color/white"
android:textSize="16sp" />
<Spinner
android:id="#+id/stateSpinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="60" />
</LinearLayout>
<LinearLayout
android:id="#+id/empLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible">
<android.support.design.widget.TextInputLayout
android:id="#+id/empCodeWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/empCodeEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<!--<android.support.design.widget.TextInputLayout
android:id="#+id/empDivCodeWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/empDivCodeEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>-->
</LinearLayout>
<Button
android:id="#+id/finishSignupBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Sign Up"
android:textColor="#android:color/white" />
</LinearLayout>
</FrameLayout>
</ScrollView>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/main_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="#+id/loginBackgroundIv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
tools:ignore="ContentDescription"/>
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/profilePicIv"
android:layout_width="135dp"
android:layout_height="110dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:scaleType="centerCrop"
app:civ_border_color="#fff"
app:civ_border_width="2dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="130dp"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:id="#+id/nameWraper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/nameEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:singleLine="true"
android:textColor="#ffffff" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/phoneWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/phoneEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:maxLength="10"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/emailWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/emailEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:id="#+id/pwdLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:id="#+id/pwdwrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/pwdEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textWebPassword"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/repwdwrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/repwdEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textWebPassword"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<!--<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="100">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="40"
android:padding="8dp"
android:text="User type ?"
android:textColor="#android:color/white"
android:textSize="16sp" />
<Spinner
android:id="#+id/userTypeSpinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="60"
android:entries="#array/userTypeArray" />
</LinearLayout>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="100">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="40"
android:padding="8dp"
android:text="State ?"
android:textColor="#android:color/white"
android:textSize="16sp" />
<Spinner
android:id="#+id/stateSpinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="60" />
</LinearLayout>
<LinearLayout
android:id="#+id/empLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible">
<android.support.design.widget.TextInputLayout
android:id="#+id/empCodeWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/empCodeEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<!--<android.support.design.widget.TextInputLayout
android:id="#+id/empDivCodeWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/empDivCodeEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>-->
</LinearLayout>
<Button
android:id="#+id/finishSignupBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Sign Up"
android:textColor="#android:color/white" />
</LinearLayout>
</FrameLayout>
ScrollView can have only one child view. Make a LinearLayout inside ScrollView to wrap all of child view. Like -
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="#+id/loginBackgroundIv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="#drawable/login_bg"
tools:ignore="ContentDescription"/>
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/profilePicIv"
android:layout_width="135dp"
android:layout_height="110dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:scaleType="centerCrop"
android:src="#drawable/user"
app:civ_border_color="#fff"
app:civ_border_width="2dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="130dp"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:id="#+id/nameWraper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/nameEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:singleLine="true"
android:textColor="#ffffff" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/phoneWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/phoneEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:maxLength="10"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/emailWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/emailEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:id="#+id/pwdLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:id="#+id/pwdwrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/pwdEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textWebPassword"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/repwdwrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/repwdEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textWebPassword"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<!--<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="100">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="40"
android:padding="8dp"
android:text="User type ?"
android:textColor="#android:color/white"
android:textSize="16sp" />
<Spinner
android:id="#+id/userTypeSpinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="60"
android:entries="#array/userTypeArray" />
</LinearLayout>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="100">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="40"
android:padding="8dp"
android:text="State ?"
android:textColor="#android:color/white"
android:textSize="16sp" />
<Spinner
android:id="#+id/stateSpinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="60" />
</LinearLayout>
<LinearLayout
android:id="#+id/empLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible">
<android.support.design.widget.TextInputLayout
android:id="#+id/empCodeWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/empCodeEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<!--<android.support.design.widget.TextInputLayout
android:id="#+id/empDivCodeWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/empDivCodeEt"
style="#style/custom_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>-->
</LinearLayout>
<Button
android:id="#+id/finishSignupBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Sign Up"
android:textColor="#android:color/white" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</FrameLayout>

TextInputLayout inside the scrollview

I am using TextInputLayout inside the scrollview , when i come to the app then the view is visible fine but when i start scrollview then the view start scrollview but original view is also shown below it. I am attaching the snapshot please let me know the problem.
when i come to the app it looks like this :
and when i start scrolling it looks like this :
Here is my code:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background = "#android:color/transparent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/attch_photo_ll"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_margin="5dp"
android:background="#CBCFD3"
>
<Button
android:id="#+id/attach_photo_btn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#null"
android:textStyle="bold"
android:textSize="#dimen/_13sdp"
android:inputType="textNoSuggestions"
android:paddingLeft="10dp"
android:textColor="#android:color/white"
android:text="Attach Photo"
/>
</LinearLayout>
<LinearLayout
android:id="#+id/photo_ll"
android:visibility="gone"
android:layout_width="#dimen/image_width"
android:layout_height="#dimen/image_height"
android:layout_margin="5dp"
android:layout_gravity="center"
android:gravity="center">
<ImageView
android:id="#+id/photo_img"
android:adjustViewBounds="true"
android:layout_width="#dimen/image_width"
android:layout_height="#dimen/image_height"
android:scaleType="fitXY"/>
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_username"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/firstName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="First Name" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_lastName"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/lastName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Last Name" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_mobile_one"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/mobile_one"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Mobile 1" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_mobile_two"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/mobile_two"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Mobile 2 (Optional)" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_email"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Email" />
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="#dimen/_8sdp"
android:orientation="horizontal"
android:weightSum="3">
<android.support.design.widget.TextInputLayout
android:layout_weight="1"
android:id="#+id/input_layout_aadhar_card"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/aadhar_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Aadhar No." />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/aadhar_card1"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/aadhar_card2"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="#dimen/_8sdp"
android:layout_marginBottom="#dimen/_8sdp"
android:orientation="horizontal"
android:weightSum="3">
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_pancard"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/pancard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Pan Card No."/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_pancard1"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/pancard1"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_pancard2"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/pancard2"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
Try this.
Remove the hint from the EditText and add the hint to TextInputLayout in your layout
For e.g
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_username"
android:layout_width="match_parent"
android:hint="First Name"
android:layout_height="wrap_content">
<EditText
android:id="#+id/firstName"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
please copy and paste following layout file with your existing your problem was solved:
<?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"
android:background="#android:color/transparent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="#+id/attch_photo_ll"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_margin="5dp"
android:background="#CBCFD3">
<Button
android:id="#+id/attach_photo_btn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#null"
android:inputType="textNoSuggestions"
android:paddingLeft="10dp"
android:text="Attach Photo"
android:textColor="#android:color/white"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/photo_ll"
android:layout_width="#dimen/image_width"
android:layout_height="#dimen/image_height"
android:layout_gravity="center"
android:layout_margin="5dp"
android:gravity="center"
android:visibility="gone">
<ImageView
android:id="#+id/photo_img"
android:layout_width="#dimen/image_width"
android:layout_height="#dimen/image_height"
android:adjustViewBounds="true"
android:scaleType="fitXY" />
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="First Name">
<EditText
android:id="#+id/firstName"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_lastName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Last Name">
<EditText
android:id="#+id/lastName"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_mobile_one"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Mobile 1">
<EditText
android:id="#+id/mobile_one"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_mobile_two"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Mobile 2 (Optional)">
<EditText
android:id="#+id/mobile_two"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Email">
<EditText
android:id="#+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:orientation="horizontal"
android:weightSum="3">
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_aadhar_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="Aadhar No.">
<EditText
android:id="#+id/aadhar_card"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<EditText
android:id="#+id/aadhar_card1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<EditText
android:id="#+id/aadhar_card2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:orientation="horizontal"
android:weightSum="3">
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_pancard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="Pan Card No.">
<EditText
android:id="#+id/pancard"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_pancard1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<EditText
android:id="#+id/pancard1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_pancard2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<EditText
android:id="#+id/pancard2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
</LinearLayout>

Tool bar is moving up on keyboard launch in EditText focus

Activity Toolbar is moving up when keyboard launches
is there any problem in my layout.
Tried solutions:
Android Toolbar moves up when keyboard appears
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="#E0E0E0"
tools:context="com.moozup.moozup_new.activity.EditMyProfileActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/Theme.DesignDemo.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar_edit_id"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary">
<TextView
android:id="#+id/text_profile_reset_id"
style="?android:actionBarTabTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginEnd="40dp"
android:drawableLeft="#android:drawable/ic_menu_rotate"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:text="Reset" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<include layout="#layout/edit_mtprofile_content" />
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab_save_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackgroundBorderless"
android:layout_gravity="bottom|end"
android:layout_margin="#dimen/fab_margin"
app:srcCompat="#android:drawable/ic_menu_save" />
</android.support.design.widget.CoordinatorLayout>
And Main Content is Here:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:isScrollContainer="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="50dp" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="20dp"
android:layout_gravity="center"
tools:context=".activity.EditProfileActivity">
<android.support.v7.widget.CardView
android:id="#+id/parent_cardView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="50dp"
app:cardBackgroundColor="#android:color/white"
app:cardCornerRadius="#dimen/cardview_default_radius"
app:cardElevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="80dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_first_name_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="First Name"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_last_name_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Last Name"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_email_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="email"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_designation_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Designation"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_company_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Company"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_contact_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Contact"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_address_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Address"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_description_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="About"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_talk_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Talk to me"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_linked_in_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Linked Url"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_facebook_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Twitter Url"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_twitter_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Twitter Url"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<RelativeLayout
android:id="#+id/prof"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:elevation="10dp">
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/circular_edit_image_id"
android:layout_width="130dp"
android:layout_height="130dp"
android:layout_gravity="center_horizontal"
android:src="#drawable/user_image"
app:finalHeight="#dimen/image_final_width"
app:finalYPosition="2dp"
app:startHeight="2dp"
app:startToolbarPosition="2dp"
app:startXPosition="2dp" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab_edit_camera_id"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignBottom="#id/circular_edit_image_id"
android:layout_alignEnd="#id/circular_edit_image_id"
android:scaleType="fitXY"
app:fabSize="normal"
app:layout_anchorGravity="bottom"
app:srcCompat="#drawable/ic_menu_camera" />
</RelativeLayout>
</FrameLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
Is there any problem with layout design.
Any suggestions?Thanks in advance.
Sample ScreenShot:
enter image description here
Set isScrollContainer to true
android:isScrollContainer="true"
Hope this helps :)

Android ScrollView not working properly when use toolbar

I developed an android application in which the scroll-view is not scrolling.. I am posting the code here pls check and if found any error pls help.. Here I used RelativeLayout as root and then Scroll-view and Relative Layout inside the scroll-view and ... Edit text ans Spinner inside relative layout... but this is not scrolling up..
This is my XML :-
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/white">
<LinearLayout
android:id="#+id/ll1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="#+id/tool_bar"
layout="#layout/app_bar" />
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:scrollbars="none"
android:layout_above="#+id/btnAccept"
android:layout_below="#+id/ll1"
>
<RelativeLayout
android:id="#+id/rel_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin">
<TextView
android:id="#+id/txvPanmain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="WANT TO GET IN TOUCH WITH US?"
android:textColor="#131517"
android:textSize="18sp"
android:textStyle="bold" />
<android.support.design.widget.TextInputLayout
android:id="#+id/floatedtFullName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txvPanmain"
android:layout_marginTop="10dp">
<EditText
android:id="#+id/edtFullName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:focusable="true"
android:hint="Full Name"
android:inputType="textCapSentences"
android:textColor="#android:color/black"
android:textColorHint="#ff0000"
android:textSize="18sp" />
</android.support.design.widget.TextInputLayout>
<Spinner
android:id="#+id/spinCountry"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/floatedtFullName"
android:layout_marginTop="15dp"
android:entries="#array/country"
android:prompt="#string/addressProof" />
<View
android:id="#+id/vspincountry"
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_below="#+id/spinCountry"
android:layout_marginTop="2dp"
android:background="#000000" />
<Spinner
android:id="#+id/spinCity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/vspincountry"
android:layout_marginTop="15dp"
android:entries="#array/country"
android:prompt="#string/addressProof" />
<View
android:id="#+id/vspincity"
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_below="#+id/spinCity"
android:layout_marginTop="2dp"
android:background="#000000" />
<android.support.design.widget.TextInputLayout
android:id="#+id/float_edit_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/vspincity"
android:layout_marginTop="10dp">
<EditText
android:id="#+id/edtEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:focusable="true"
android:hint="Email id"
android:inputType="textEmailAddress"
android:textColor="#android:color/black"
android:textColorHint="#A4A4A4"
android:textSize="18sp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/float_edit_mobileno"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/float_edit_email"
android:layout_marginTop="10dp">
<EditText
android:id="#+id/edtMobile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:focusable="true"
android:hint="Mobile no."
android:inputType="phone"
android:maxLength="10"
android:textColor="#android:color/black"
android:textColorHint="#A4A4A4"
android:textSize="18sp" />
</android.support.design.widget.TextInputLayout>
<Spinner
android:id="#+id/spinFeedback"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/float_edit_mobileno"
android:layout_marginTop="10dp"
android:entries="#array/country"
android:prompt="#string/addressProof" />
<View
android:id="#+id/vspinFeedback"
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_below="#+id/spinFeedback"
android:layout_marginTop="2dp"
android:background="#000000" />
<android.support.design.widget.TextInputLayout
android:id="#+id/float_edit_comments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/vspinFeedback"
android:layout_marginTop="10dp">
<EditText
android:id="#+id/edtComments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:focusable="true"
android:inputType="text"
android:hint="Comments"
android:lines="3"
android:maxLines="3"
android:textColor="#android:color/black"
android:textColorHint="#A4A4A4"
android:textSize="18sp" />
</android.support.design.widget.TextInputLayout>
</RelativeLayout>
</ScrollView>
<Button
android:id="#+id/btnAccept"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/red"
android:layout_alignParentBottom="true"
android:padding="5dp"
android:text="SUBMIT"
android:textColor="#color/white_color"
android:textSize="20sp"
android:textStyle="normal" />
<ProgressBar
android:id="#+id/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="gone" />
</RelativeLayout>
This is my app_bar.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar 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="wrap_content"
android:background="#color/colorPrimary"
android:paddingTop="#dimen/app_bar_top_padding"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"
app:theme="#style/Base.ThemeOverlay.AppCompat.Dark.ActionBar">
<TextView
android:id="#+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textSize="22sp"
android:textColor="#android:color/white"
android:textStyle="bold"
android:text="Toolbar Title" />
</android.support.v7.widget.Toolbar>
Your ScrollView has to be a defined height. Try match_parent instead of wrap_content. When a ScrollView wraps its contents there is nothing beeing clipped of you might be able to scroll to.

Categories

Resources