Android open keyboard change layout -
i want make layout contains 3 edittexts
, 2 buttons
. when create layout , open soft keyboard views hidden. , used `scrollview.
my code below:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ffffff"> <android.support.v7.widget.toolbar android:id="@+id/my_awesome_toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:layout_alignparenttop="true" android:background="#ffffff"> <textview android:id="@+id/toolbar_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:ellipsize="end" android:singleline="true" android:text="sign up" android:textappearance="?android:attr/textappearancemedium" android:textcolor="#000000" android:textsize="20sp" android:textstyle="bold" /> </android.support.v7.widget.toolbar> <scrollview android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/my_awesome_toolbar" android:fillviewport="true" android:orientation="vertical"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent"> <edittext android:id="@+id/name" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginleft="10dp" android:layout_marginright="10dp" android:layout_margintop="5dp" android:background="@drawable/code_selector" android:gravity="center" android:hint="name" android:padding="12dp" android:singleline="true" android:textcolor="#000000" /> <edittext android:id="@+id/password" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/name" android:layout_marginleft="10dp" android:layout_marginright="10dp" android:layout_margintop="5dp" android:background="@drawable/code_selector" android:gravity="center" android:hint="password" android:inputtype="textpassword" android:padding="12dp" android:singleline="true" android:textcolor="#000000" /> <edittext android:id="@+id/email" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/password" android:layout_marginbottom="10dp" android:layout_marginleft="10dp" android:layout_marginright="10dp" android:layout_margintop="5dp" android:background="@drawable/code_selector" android:gravity="center" android:hint="email" android:padding="12dp" android:singleline="true" android:textcolor="#000000" /> <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_below="@id/email"> <com.facebook.login.widget.loginbutton android:id="@+id/btnfacebooklogin" style="@style/facebookloginbutton" android:layout_width="match_parent" android:layout_height="50dp" android:layout_alignparentbottom="true" android:layout_centerhorizontal="true" /> <textview android:id="@+id/textor" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@+id/btnfacebooklogin" android:layout_margin="5dp" android:gravity="center" android:text="or" android:textstyle="bold|italic" /> <button android:id="@+id/btnnext" android:layout_width="match_parent" android:layout_height="50dp" android:layout_above="@+id/textor" android:layout_centerhorizontal="true" android:layout_marginbottom="10dp" android:layout_marginleft="10dp" android:layout_marginright="10dp" android:layout_margintop="10dp" android:background="#aa008000" android:text="next" android:textallcaps="false" android:textcolor="#ffffff" /> </relativelayout> </relativelayout> </scrollview>
please me solve this. thank you.
if issue views bing hidden keyboard view should still scrollable due scrollview
. if not, consider using either android:windowsoftinputmode="adjustresize"
or android:windowsoftinputmode="adjustpan"
enclosing activity in manifest
Comments
Post a Comment