Android not able to scroll up -
i have login layout 2 edittext
, button
. when i'm typing text in edittext
, keyboard open overlap of layout
. try scroll not able scroll layout visible. I'm using relative layout create it. how solve it? thank you.
place edittext
s , button
inside scrollview
. whatever inside scrollview
can scrolled. problem solved.
note scrollview
can host 1 child. have place view
s inside viewgroup
linearlayout
or relativelayout
although julia zhao's answer correct, uses relativelayout
. if use relativelayout
have more work make view
s appear 1 below other. suggest use linearlayout
android:orientation="vertical"
inside it. automatically place 1 view
below other without effort. won't issues 1 view
overlapping on other.
<?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content"> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <edittext android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="username"/> <edittext android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margintop="10dp" android:hint="password"/> <button android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margintop="10dp" android:text="login"/> </linearlayout> </scrollview>
Comments
Post a Comment