问题描述
我们要申请新的Android奇巧半透明的主题,在我们的应用程序,以及我们得到一个奇怪的问题出现在键盘的时候。如果我们不使用新的安卓windowTranslucentStatus
属性,所有的作品像往常一样:屏幕大小,所有仍然可见。但是,当我们使用安卓windowTranslucentStatus
,屏幕不调整,我们的的EditText
变成由键盘隐藏
We're applying the new Android KitKat translucent theme in our apps, and we're getting a weird issue when the keyboard appears. If we don't use the new android:windowTranslucentStatus
attribute, all works as usual: The screen is resized, and all remains visible. But when we're using android:windowTranslucentStatus
, the screen isn't resized and our EditText
becomes hidden by the keyboard.
该问题的一个示例:
A sample of the issue:
的屏幕之间的唯一区别是在风格属性:
The only difference between the screens is in the attribute in the style:
第一个屏幕:<项目名称=机器人:windowTranslucentStatus>假< /项目>
第二个画面:<项目名称=机器人:windowTranslucentStatus>真< /项目>
我们认为这是奇巧的释放一个错误,但我们希望你能意识到这一点。我们开始有点疯狂。当然,如果有人有一个解决方案,这将是惊人的。
We think this is a bug from Kitkat release, but we want you to be aware of this. We're getting a little mad. Of course, if someone have a solution, it will be amazing.
编辑:我只是说这个问题到Android问题跟踪。也许你会感兴趣的主演了这个问题: http://kcy.me/wifr
I just added this issue to the Android issue tracker. Probably you'll be interested in starring the issue: http://kcy.me/wifr
推荐答案
我也遇到了这个很烦人的问题。但最终我得到了这个工作:
I also ran into this very annoying issue. But eventually I got this working:
<style name="Theme.MyApp">
<item name="android:windowTranslucentStatus">true</item>
</style>
相反,在主题设置fitSystemWindows =真的
,我在我的布局的根视图。
Instead of setting fitSystemWindows="true" in the theme, I set it on the root view of my layout..
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</FrameLayout>
我也用了很大的 SystemBarTintManager 在我的活动:
new SystemBarTintManager(this).setStatusBarTintEnabled(true);
这似乎运作良好,但无可否认,似乎pretty的善变。希望它可以帮助别人呢!
This seems to work well, but admittedly seems pretty fickle. Hope it helps someone anyway!
这篇关于键盘隐藏的EditText当机器人:windowTranslucentStatus =真的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!