2014-09-01 110 views
1

我一直都陷入这个问题。 我想创建自己的启动器,我希望它具有透明的状态和导航栏,如谷歌现在启动4.4 +。 Tuts在互联网上显示所有相同的代码添加到我的应用程序,但它似乎有什么问题,我的。Android半透明主题不起作用

我使用android:Theme.Holo.Light.NoActionBar.TranslucentDecor 以及

<item name="android:windowTranslucentStatus">true</item> 
<item name="android:windowTranslucentNavigation">true</item> 

是这样的了: http://i.imgur.com/RaRQvPc.png 取而代之的是正常的行为像其他发射器。我如何实现这一目标?

提前致谢!

UPDATE: 其实在我的模拟器有奇巧这项工作,目标版本是19 好像有只20 API的麻烦,没有谷歌和其他人因此如何设法保持甚至在Android L移动预览半透明的看法?

回答

0

我想这让这里的答案: Android 4.4 translucent Status and Navigation bars style on Android 5.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);