android making layout scrollable when soft keyboard open, but not shifting it upwards -
this screen, 1 button hidden behind keyboard.
i want this, scrollable. -
whenever, keyboard gets opened, want make same in image. but, instead make scrollable, user can scroll view bottom part of screen (including button), when keyboard open.
i tried -
android:windowsoftinputmode="adjustresize"
but, shifts bottom part upwards, whenever keyboard opened.
as in image -
i don't want this - (shifting of create account
button upwards, when keypad opened)
create account button must visible after scrolling.
here layout -
<scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/root_layout" android:fillviewport="true" > <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:weightsum="10" > <linearlayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="9" android:orientation="vertical" android:gravity="center_vertical|center_horizontal" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:paddingbottom="@dimen/activity_vertical_margin"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:orientation="vertical"> <edittext android:id="@+id/et_username_or_email" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/et_hint_username_or_email" android:inputtype="textemailaddress" android:singleline="true" /> <edittext android:id="@+id/et_pswd" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/et_hint_password" android:password="true" android:singleline="true" /> <button android:id="@+id/btn_sign_in" android:layout_margintop="10dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/btn_sign_in" android:background="@color/lighter_orange" android:textcolor="@android:color/white"/> <textview android:layout_margintop="10dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/or" android:gravity="center_horizontal" android:textcolor="@android:color/black"/> <button android:id="@+id/btn_take_a_peek" android:layout_margintop="10dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/btn_take_a_peek" android:textcolor="@android:color/white" android:background="@color/button_gray"/> <textview android:layout_margintop="15dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/forgot_password" android:gravity="center_horizontal" android:textcolor="@color/text_gray"/> </linearlayout> </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:orientation="vertical"> <button android:id="@+id/btn_create_account" android:layout_width="match_parent" android:layout_height="match_parent" android:text="@string/btn_create_account" android:background="@color/button_very_light_orange" android:textcolor="@android:color/white"/> </linearlayout> </linearlayout> </scrollview>
please me fix up.
add input mode in manifest file.
android:windowsoftinputmode="statehidden|adjustresize"
Comments
Post a Comment