2

I am having an edittext in my app. I am using adjustPan to shift layout accordingly when keyboard opens. But when keyboard opens it does shift the layout but it still cuts the edittext and does not shift completely . I also tried adding layout to scrollview and adding padding bottom but it didn't helped. I also tried adjustResize but that also didn't worked. Here is the screen shot of both cases Without KeyboardWith Keyboard

Here is the manifest file(only this activity

<activity android:name=".activity.ActivityRegister"
        android:windowSoftInputMode="adjustResize|adjustPan"/>

And layout file

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/bg">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="50dp"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.socialninjaz.doorstep.MainActivity"
    android:orientation="vertical">
<ImageView
    android:layout_width="200dp"
    android:layout_height="200dp"
    android:layout_gravity="center"
    android:layout_marginTop="100dp"
    android:src="@drawable/logo"/>
<EditText
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:layout_marginTop="40dp"
    android:background="@drawable/rounded_rectangle"
    android:hint="Enter Your Phone Number"
    android:paddingLeft="10dp"
    android:textColorHint="#D92027"
    android:textSize="18sp"
    android:id="@+id/et_phone_number"
    android:inputType="phone"
    android:maxLength="10"/>
    <Button
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="25dp"
        android:layout_gravity="center"
        android:text="register"
        android:padding="10dp"
        android:textColor="#D92027"
        android:background="@drawable/rounded_rectangle"
        android:textSize="16sp"
        android:id="@+id/btn_register"/>
</LinearLayout>
</ScrollView>
Vivek Mishra
  • 5,669
  • 9
  • 46
  • 84

0 Answers0