[英]ActionBar is hiding when keyboard appears
I'm using ActionBarSherlock. 我正在使用ActionBarSherlock。
windowSoftInputMode
is adjustPan
(I've tried with adjustResize
and adjustNothing
also). windowSoftInputMode
是adjustPan
(我尝试过adjustResize
和adjustNothing
)。
I want to keep ActionBar
on screen when keyboard appears but slide my layout instead (so text remains visible). 我希望在键盘出现时将
ActionBar
保留在屏幕上, 而是滑动我的布局(因此文本仍然可见)。
Here is how it looks right: 这是它看起来正确的方式:
And when keyboard is appeared: 键盘出现时:
Question is : how can I keep ActionBar
visible while using adjustPan
(so EditText
s will always be visible)? 问题是 :如何在使用
adjustPan
保持ActionBar
可见(因此EditText
将始终可见)?
NOTE I can't use ScrollView
to hold my View
注意我不能使用
ScrollView
来保存我的View
I find out, that there may be problems with adjustResize
(for some reason it's just uses adjustPan
instead) when you applying FLAG_FULLSCREEN
to Window
of Activity
: 我发现,当您将
FLAG_FULLSCREEN
应用于Activity
Window
时, adjustResize
可能存在问题(出于某种原因,它只是使用adjustPan
):
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Without this line resizing working just fine. 没有这条线调整工作就好了。
it looks like the layout slides up to make some space for the keyborad try: 它看起来像布局滑动为keyborad尝试创建一些空间:
add this to your manifest.xml: 将其添加到manifest.xml:
<activity android:name=".YourActivity" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation|keyboard" />
the important part is: android:configChanges="keyboardHidden|orientation|keyboard" 重要的部分是: android:configChanges =“keyboardHidden | orientation | keyboard”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.