【发布时间】:2019-08-23 20:28:09
【问题描述】:
我尝试了Android: How do I prevent the soft keyboard from pushing my view up?中的所有内容
但没有一个对我不起作用 这是我的xml
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/footer"
android:layout_below="@+id/header"
android:isScrollContainer="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:orientation="vertical">
<....Widgets>
</LinearLayout>
</scrollview>
<com.mypackage.activities.Footer
android:id="@+id/footer"
android:layout_width="match_parent"
android:layout_height="@dimen/footerHeight"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
以及在 Manifest 文件中使用的 adjustResize、adjsutPan、adjustNothing
【问题讨论】:
-
图片会更容易,所以我们确切地知道您所看到的以及您想要的。假设您希望键盘出现在页脚上方,您需要处于 adjustPan 模式。
-
如果您不想让软键盘向上推动页脚视图,那么您应该使用带有 vscrollview` 的
adjustnothing作为根布局。 -
@GabeSechan with adjustPan 页脚被推送但滚动视图不起作用
-
@AbidKhan 如果我将滚动视图设为根视图,那么页脚也会滚动,但我不想滚动页脚
-
@GabeSechan 错字 *页脚没有被推送
标签: android android-layout scrollview android-keypad