I am trying to create a login screen. I have used ScrollView to hold input fields. I have following xml:
<RelativeLayout ... >
<RelativeLayout
android:id="@+id/top_menu" ... >
<ImageButton ... />
<com.neopixl.pixlui.components.textview.TextView... />
</RelativeLayout>
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/top_menu"
android:overScrollMode="always">
<LinearLayout
android:id="@+id/login_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<com.neopixl.pixlui.components.edittext.EditText
android:id="@+id/user_name_email"
android:layout_width="match_parent"
android:layout_height="@dimen/input_height_size"
android:layout_marginEnd="20dp"
android:layout_marginStart="20dp"
android:background="@drawable/edit_text_strock"
android:hint="@string/user_Name_Email_EditText"
android:maxLines="1"
android:paddingLeft="10dp"
android:paddingStart="10dp"
android:textColor="@color/White"
android:textColorHint="@color/White"
android:textSize="@dimen/register_input_text_size"
pixlui:typeface="MuseoSans.otf"/>
<com.neopixl.pixlui.components.edittext.EditText.... />
<com.neopixl.pixlui.components.button.Button... />
<com.neopixl.pixlui.components.textview.TextView... />
<com.neopixl.pixlui.components.textview.TextView... />
<com.neopixl.pixlui.components.textview.TextView... />
<com.neopixl.pixlui.components.button.Button... />
</LinearLayout>
</ScrollView>
</RelativeLayout>
You can see full xml here. When I click on EditText user_name_email, it goes off the screen.
Before click:
After click:
I have tried scrollTo(x, y)
and smootScrollTo(x, y)
bu they didn't work.
How can I fix it?
UPDATE:
adjustPan
works but I want it to work with adjustResize
.
Is it possible?
Use the following line in the manifest file, for the activity you need the change.
Use it as shown below:
Hope this helps.