软键盘推入页脚视图

时间:2019-04-02 13:28:30

标签: android android-layout scrollview android-keypad

我在此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

enter image description here

1 个答案:

答案 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>