Android 在打开键盘和调整面板的情况下滚动到底部
当WindowsofInputMode=“adjustPan”时,键盘覆盖按钮时,是否可以滚动到与布局底部对齐的按钮 我不想使用WindowsOfInputMode=“adjustResize”,因为我希望按钮位于键盘下方,并且我希望在打开键盘时滚动到按钮 布局示例:Android 在打开键盘和调整面板的情况下滚动到底部,android,android-layout,Android,Android Layout,当WindowsofInputMode=“adjustPan”时,键盘覆盖按钮时,是否可以滚动到与布局底部对齐的按钮 我不想使用WindowsOfInputMode=“adjustResize”,因为我希望按钮位于键盘下方,并且我希望在打开键盘时滚动到按钮 布局示例: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" a
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:layout_width="match_parent"
android:layout_height="70dp"
android:hint="edit text" />
<EditText
android:layout_width="match_parent"
android:layout_height="70dp"
android:hint="edit text" />
</LinearLayout>
</ScrollView>
<Button
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:text="button" />
</RelativeLayout>
我需要滚动到键盘下的按钮:
尝试此添加
android.support.v4.widget.NestedScrollView
而不是Relativelayout,并使android:transcriptMode=“alwaysScroll”
始终滚动
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
<ScrollView
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:transcriptMode="alwaysScroll">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:layout_width="match_parent"
android:layout_height="70dp"
android:hint="edit text" />
<EditText
android:layout_width="match_parent"
android:layout_height="70dp"
android:hint="edit text" />
<Button
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:text="button" />
</LinearLayout>
</ScrollView>
</android.support.v4.widget.NestedScrollView>