我被这个问题困了一整天。我想创建我自己的启动程序,我希望它具有透明的状态和导航栏,就像谷歌现在在4.4+上的启动器。Tuts在互联网上显示了所有相同的代码添加到我的应用程序,但它似乎有什么问题,我的。
我从使用android:Theme.Holo.Light.NoActionBar.TranslucentDecor
得到了什么以及
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
它是:http://i.imgur.com/RaRQvPc.png而不是正常的运行方式,就像其他的启动程序一样。我怎样才能做到这一点?
提前感谢!
更新:实际上,在我的仿真器上使用KitKat,目标版本是19。看起来仅仅在api 20上有问题,那么谷歌和其他人是如何在Android预览版中保持半透明视图的呢?
发布于 2014-12-14 07:12:43
我想这里有一个答案:Android 4.4在Android5.0上的半透明状态和导航条样式
对于状态和导航:
以你的风格:
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:windowTranslucentStatus">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
在Java中:
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
https://stackoverflow.com/questions/25600762
复制相似问题