1

i searched a lot on google and i found many solutions but nothing is working for me . i am producing screen shots that will explain where and why am facing this issue .

Normal Screen with Out Soft Key Board Image:

img1

After Soft Keyboard appearance Button hides Last Edit Text:

img2

In this layout i used Relative layout and Scroll View and whatever solution i got from google i used that one. putting this into manifest file also

android:windowSoftInputMode="stateVisible|adjustResize"

So i am looking for valuable suggestions and Views . If you are not able to understand my doubt, please ask to me. Thank you for valuable time and support

Here i am updating XML file code which i have written .

  <?xml version="1.0" encoding="utf-8"?>
<ScrollView 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:fillViewport="true">

    <RelativeLayout

        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        tools:context="com.example.yadapras.mobiltyemp.Registration"
        android:orientation="vertical">

    <EditText
        android:id="@+id/user_name1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/reg_name"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="50dp"/>

    <EditText
        android:id="@+id/user_pass"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/reg_password"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="5dp"
        android:layout_below="@+id/user_name1"/>

    <EditText
        android:id="@+id/user_re_pass"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/reg_re_password"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="5dp"
        android:layout_below="@+id/user_pass"/>

    <EditText
        android:id="@+id/user_full_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/reg_fullname"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="5dp"
        android:layout_below="@+id/user_re_pass"/>

    <EditText
        android:id="@+id/user_mail"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/reg_email"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="5dp"
        android:layout_below="@+id/user_full_name"/>

    <EditText
        android:id="@+id/user_ph_no"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/reg_ph_no"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="5dp"
        android:layout_below="@+id/user_mail"/>

    <EditText
        android:id="@+id/user_emei_No"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Device IMEI No"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="5dp"
        android:layout_below="@+id/user_ph_no"
        />

     <EditText
         android:id="@+id/user_device_model"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:hint="Device Model"
         android:layout_marginLeft="15dp"
         android:layout_marginRight="15dp"
         android:layout_marginTop="5dp"
         android:layout_below="@+id/user_emei_No"/>

        <EditText
            android:id="@+id/user_OS_Version"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="OS Version"
            android:layout_marginLeft="15dp"
            android:layout_marginRight="15dp"
            android:layout_marginTop="5dp"
            android:layout_below="@+id/user_device_model" />

        <Button
        android:id="@+id/reg_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/register"
        android:layout_alignParentBottom="true"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:textStyle="bold|italic"
       />
    </RelativeLayout>

</ScrollView>
jayeshsolanki93
  • 2,096
  • 1
  • 20
  • 37
Pranshu Singh
  • 73
  • 1
  • 10

3 Answers3

2

Try This Code..!!

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@mipmap/login_bg">
<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">


    <RelativeLayout

        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        tools:context="com.example.yadapras.mobiltyemp.Registration"
        android:orientation="vertical">

    <EditText
        android:id="@+id/user_name1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/reg_name"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="50dp"/>

    <EditText
        android:id="@+id/user_pass"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/reg_password"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="5dp"
        android:layout_below="@+id/user_name1"/>

    <EditText
        android:id="@+id/user_re_pass"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/reg_re_password"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="5dp"
        android:layout_below="@+id/user_pass"/>

    <EditText
        android:id="@+id/user_full_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/reg_fullname"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="5dp"
        android:layout_below="@+id/user_re_pass"/>

    <EditText
        android:id="@+id/user_mail"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/reg_email"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="5dp"
        android:layout_below="@+id/user_full_name"/>

    <EditText
        android:id="@+id/user_ph_no"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/reg_ph_no"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="5dp"
        android:layout_below="@+id/user_mail"/>

    <EditText
        android:id="@+id/user_emei_No"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Device IMEI No"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="5dp"
        android:layout_below="@+id/user_ph_no"
        />

     <EditText
         android:id="@+id/user_device_model"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:hint="Device Model"
         android:layout_marginLeft="15dp"
         android:layout_marginRight="15dp"
         android:layout_marginTop="5dp"
         android:layout_below="@+id/user_emei_No"/>

        <EditText
            android:id="@+id/user_OS_Version"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="OS Version"
            android:layout_marginLeft="15dp"
            android:layout_marginRight="15dp"
            android:layout_marginTop="5dp"
            android:layout_below="@+id/user_device_model" />

        <Button
        android:id="@+id/reg_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/register"
        android:layout_alignParentBottom="true"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:textStyle="bold|italic"
       />
    </RelativeLayout>

    </LinearLayout>
</ScrollView>
</RelativeLayout>
Mayur Patel
  • 2,300
  • 11
  • 30
0

Try this..

android:windowSoftInputMode="stateHidden|adjustPan" in your android manifest file

Harshad Pansuriya
  • 20,189
  • 8
  • 67
  • 95
Hari
  • 490
  • 1
  • 4
  • 12
  • instead of this android:windowSoftInputMode="stateVisible|adjustResize" you can use android:windowSoftInputMode="stateHidden|adjustPan" this code in your manifest. – Hari Jul 14 '16 at 13:25
  • i updated the code but didn't ful fil my requirement – Pranshu Singh Jul 14 '16 at 13:35
0

just add this property to your Button

  android:layout_below="@+id/user_OS_Version"

full code :

 <Button
                android:id="@+id/reg_button"
                android:layout_below="@+id/user_OS_Version"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="register"
                android:layout_alignParentBottom="true"
                android:layout_marginLeft="15dp"
                android:layout_marginRight="15dp"
                android:textStyle="bold|italic"
                />

Output :

enter image description here

Harshad Pansuriya
  • 20,189
  • 8
  • 67
  • 95
  • i tried this one but output will come fine , but it will give another issue .. in normal screen butoon size will increase – Pranshu Singh Jul 14 '16 at 13:32
  • @PranshuSingh change width to `wrap_content` it will solve your problem.. It is because You have `match_parent` width in `RelativeLayout`. – Harshad Pansuriya Jul 14 '16 at 13:34