[英]The button is not scrolling up when the keyboard pop up
The button is not scrolling up when the keyboard pops up. 弹出键盘时,按钮没有向上滚动。 I have tried this:
我已经试过了:
android:windowSoftInputMode="adjustPan|adjustResize".
I think the problem is with the XML. 我认为问题出在XML。 When we click on the edit text the keyboard pops up, and I expect the button should come above the key board.
当我们单击编辑文本时,键盘会弹出,并且我希望按钮应该在键盘上方。 Please help me looking in to the XML code.
请帮助我查看XML代码。
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorWhite"
android:fillViewport="true"
android:fitsSystemWindows="true"
android:isScrollContainer="false">
<RelativeLayout
android:id="@+id/rlLogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/ivLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/min_dp"
android:layout_marginStart="@dimen/min_dp"
android:layout_marginTop="@dimen/min_dp"
android:keepScreenOn="true"
android:src="@mipmap/ic_align_splash" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/min_dp"
android:layout_marginStart="@dimen/min_dp"
android:layout_marginTop="@dimen/size_xl1"
android:text="@string/title_enter_email"
android:textSize="14sp" />
<EditText
android:id="@+id/etEmail"
style="@style/EditInput"
android:layout_marginTop="@dimen/size_s1"
android:hint="@string/hint_email"
android:inputType="textWebEmailAddress" />
<Button
android:id="@+id/btnNext"
style="@style/Button"
android:layout_marginTop="@dimen/min_dp"
android:text="@string/title_button_next" />
</LinearLayout>
<RelativeLayout
android:id="@+id/rlLogo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorWhite"
android:elevation="@dimen/size_s1"
android:visibility="gone">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@mipmap/ic_align_splash" />
</RelativeLayout>
<include
android:id="@+id/progressBar"
layout="@layout/progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom" />
</RelativeLayout>
</ScrollView>
Try adding your button and ScrollView under same parent layout. 尝试在相同的父布局下添加按钮和ScrollView。 Eg:
例如:
<RelativeLayout>
<ScrollView...../>
<Button/>
<RelativeLayout/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.