How to prevent auto scrolling of EditText when keyboard appears on Android?

女生的网名这么多〃 提交于 2019-12-11 18:15:57

问题


Even i put scrollview or not, when my edit text request focus and keyboard appears, my view automatically scrolled to top a little bit. It breaks my design. I have to prevent this.

Could you please help me?


回答1:


Addthis

 android:windowSoftInputMode="adjustPan"

   android:isScrollContainer="false" 

in the manifest file




回答2:


Add this line in your Manifext.xml under your activity tag and make sure your activity must not use android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen".

android:windowSoftInputMode="adjustResize"

Please try it and let me know your comments if still you have problem..!!



来源:https://stackoverflow.com/questions/21181767/how-to-prevent-auto-scrolling-of-edittext-when-keyboard-appears-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!