【问题标题】:How to prevent auto scrolling of EditText when keyboard appears on Android?Android上出现键盘时如何防止EditText自动滚动?
【发布时间】:2014-01-17 17:20:01
【问题描述】:

即使我是否放置了滚动视图,当我的编辑文本请求焦点和键盘出现时,我的视图会自动滚动到顶部一点。它破坏了我的设计。我必须防止这种情况发生。

你能帮帮我吗?

【问题讨论】:

    标签: android android-edittext scrollview


    【解决方案1】:

    添加这个

     android:windowSoftInputMode="adjustPan"
    
       android:isScrollContainer="false" 
    

    在清单文件中

    【讨论】:

      【解决方案2】:

      在您的 activity 标签 下的 Manifext.xml 中添加这一行,并确保您的 activity 不得使用 android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen "

      android:windowSoftInputMode="adjustResize"
      

      请尝试一下,如果仍有问题,请告诉我您的 cmets..!!

      【讨论】:

        猜你喜欢
        • 2018-07-26
        • 2018-05-30
        • 1970-01-01
        • 2020-12-28
        • 2011-09-19
        • 2018-08-21
        • 2020-12-30
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多