Soft keyboard hide EditText in lollipop version

限于喜欢 提交于 2019-12-21 20:58:39

问题


I have a layout which contain RelativeLayout as Root layout,Relative layoout contain ListView at Top and one Edittext align at the bottom of relative layout. In Pre lollipop version devices whenever soft keyboard open Edittext pushed up and I am able to see the Editext. But in lollipop soft keyboard hide the Editext. I have already set android:windowSoftInputMode="adjustPan|adjustResize" in manifest file. Please help me


回答1:


try to give fitsSystemWindows in your main layout( for lollipop versions)

 android:fitsSystemWindows="true"

also in the manifest give

android:windowSoftInputMode="adjustResize"

hope this will help




回答2:


Thanks for your valuable input. Finally I have fixed this issue.

What I found the reason behind this issue is application theme. My application theme was

android:Theme.Light in which I found this issue. I have only changed the theme of my EditText layout activity by setting

android:theme="@android:style/Theme.Black.NoTitleBar" e.g. <activity android:name=".activity.LiveStreamingActivity" android:label="@string/title_activity_event_performer" android:theme="@android:style/Theme.Black.NoTitleBar" android:screenOrientation="portrait" />

This solved my problem !!!




回答3:


May be your activity is full screen. Try clearing the FULLSCREEN flag.




回答4:


I too had the same issue and it was because of the usage of a menudrawer library which was not supported by lollipop and when I replace that with default navigation drawer of android the things started working fine.Please check with the libraries if you use any.




回答5:


The important value is the adjustResize. This will shift the whole UI up to give room for the soft keyboard.

<activity
        android:name="com.my.MainActivity"
        android:screenOrientation="portrait"
        android:label="@string/title_activity_main"
        android:windowSoftInputMode="adjustResize|stateHidden" >
    </activity>


来源:https://stackoverflow.com/questions/29397387/soft-keyboard-hide-edittext-in-lollipop-version

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