您的位置:首页 > 移动开发 > Android开发

Android4.4 全屏幕模式,沉浸模式 & 在应用内开启透明状态栏和透明虚拟按钮

2014-03-06 14:49 471 查看
众所周知,Android从4.4开始,就进入了沉浸模式,下面的链接有个视频可以观看一下。

沉浸模式
http://www.cnbeta.com/articles/265297.htm
这里有个翻译过后的文档:
http://www.apkbus.com/design/patterns/fullscreen.html
https://developer.android.com/training/system-ui/immersive.html#nonsticky 这里有实践的说明:
http://www.cnblogs.com/zhengxt/p/3508485.html

Android4.4新的特性,在应用内开启透明状态栏和透明虚拟按钮

这篇文章写的非常好,写的非常细致。
http://www.cnblogs.com/zhengxt/p/3536905.html
官方文档:
https://developer.android.com/training/system-ui/status.html
更多4.4的新特性请移步:
http://developer.android.com/about/versions/android-4.4.html

如果你是做rom开发的,请一定重点看看这2个:

一:Immersive full-screen mode

To provide your app with a layout that fills the entire screen, the new
SYSTEM_UI_FLAG_IMMERSIVE
flag for
setSystemUiVisibility()

(when combined with
SYSTEM_UI_FLAG_HIDE_NAVIGATION
) enables a newimmersive full-screen
mode. While immersive full-screen mode is enabled, your activity continues to receive all touch events. The user can reveal the system bars with an inward swipe along the region where the system bars normally appear. This clears the
SYSTEM_UI_FLAG_HIDE_NAVIGATION
flag (and the
SYSTEM_UI_FLAG_FULLSCREEN

flag, if applied) so the system bars remain visible. However, if you'd like the system bars to hide again after a few moments, you can instead use the
SYSTEM_UI_FLAG_IMMERSIVE_STICKY
flag.

二:Translucent system bars

You can now make the system bars partially translucent with new themes,
Theme.Holo.NoActionBar.TranslucentDecor
and
Theme.Holo.Light.NoActionBar.TranslucentDecor
.
By enabling translucent system bars, your layout will fill the area behind the system bars, so you must also enable
fitsSystemWindows
for the portion of your layout that should not be covered by the system bars.

If you're creating a custom theme, set one of these themes as the parent theme or include the
windowTranslucentNavigation

and
windowTranslucentStatus
style properties in your theme.

扩展阅读:


android隐藏底部虚拟键Navigation Bar实现全屏

http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2013/0709/1426.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐