How to prevent auto scrolling of EditText when key

2019-09-02 03:19发布

问题:

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..!!