问题
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