【问题标题】:EditText, adjustPan, ScrollView issue in androidandroid中的EditText,adjustPan,ScrollView问题
【发布时间】:2018-12-12 15:57:08
【问题描述】:

我有一个EditText,它包含在ScrollView 中,但是当键盘出现时。

您不能向下滚动到现在涵盖的字段。我尝试在清单和类中添加adjustSizeadjustPan

但它不起作用..

【问题讨论】:

  • 嗨,您可以找到任何解决方案

标签: android android-edittext scrollview adjustpan


【解决方案1】:

我遇到了同样的问题,我找到了解决方案。所以,也许它会对你有所帮助。

请给 ScrollView 标签提供以下属性:

android:isScrollContainer="false"

并且在您的活动清单中:

android:windowSoftInputMode="adjustPan"

【讨论】:

  • 对我不起作用。我是否添加了 android:isScrollContainer="false" 没有变化
【解决方案2】:

在你的清单文件里面的活动标签中使用

android:windowSoftInputMode="adjustResize|stateVisible|stateAlwaysHidden" 

【讨论】:

    【解决方案3】:

    只是挣扎了 3 个小时来解决同样的问题。

    对我有用的是从清单中的 windowSoftInputMode 中删除“adjustPan”。

    所以我从:

    android:windowSoftInputMode="adjustResize|adjustPan|stateHidden"
    

    到:

    android:windowSoftInputMode="adjustResize|stateHidden"
    

    它为我解决了所有问题。

    我希望这对其他偶然发现此问题的人有所帮助。有趣的是,在我的其他屏幕上,无论adjustPan如何,它都仍然有效。

    【讨论】:

      【解决方案4】:

      你只需在滚动视图中添加这一行android:isScrollContainer="true"

      像这样的东西

       <ScrollView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:fillViewport="true"
              android:isScrollContainer="true"
              android:scrollbars="none">
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-12-07
        • 1970-01-01
        • 2017-06-23
        • 2013-07-04
        • 1970-01-01
        • 2014-02-11
        相关资源
        最近更新 更多