我在此Android: How do I prevent the soft keyboard from pushing my view up?
中尝试了一切但是他们都不对我有用 这是我的xml
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id repo name status
!github_git-lfs/x86_64 github_git-lfs 46
!github_git-lfs-source github_git-lfs-source 0
nginx/x86_64 nginx repo 513
packages-microsoft-com-prod packages-microsoft-com-prod 297
ultra-centos-7.4-base UltraServe CentOS-7.4 - Base 7407
ultra-centos-7.4-extras UltraServe CentOS-7.4 - Extras 401
ultra-centos-7.4-updates UltraServe CentOS-7.4 - Updates 1836
ultra-centos-7.x-newrelic-monitoring UltraServe CentOS-7.x - New Relic Infrastructure Monitoring Agent 1
ultra-centos-7.x-ultrarepo UltraServe CentOS-7.x - UltraServe Repo Packages 32
repolist: 10533
以及清单文件中使用的AdjustResize,adjsutPan,adjustNothing
答案 0 :(得分:0)
将ScrollView
设为根布局,其中还将包含页脚布局。在Manifest
文件中,对adjustNothing
使用windowsoftinputmode
。
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/footer"
android:layout_below="@+id/header"
android:isScrollContainer="false">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:orientation="vertical">
<....Widgets>
</LinearLayout>
<com.mypackage.activities.Footer
android:id="@+id/footer"
android:layout_width="match_parent"
android:layout_height="@dimen/footerHeight"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
</scrollview>