Android 的状态栏貌似可以做到跟 iOS 一样,界面的东西延伸到顶部。
看官方文档:http://developer.android.com/training/material/theme.html
在 VLC 播放器看到这个代码,现在还不清楚具体动作,先存着:
/**
* Dim the status bar and/or navigation icons when needed on Android 3.x.
* Hide it on Android 4.0 and later
*/
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private void dimStatusBar(boolean dim) {
if (!LibVlcUtil.isHoneycombOrLater() || !AndroidDevices.hasNavBar())
return;
int layout = 0;
if (!AndroidDevices.hasCombBar() && LibVlcUtil.isJellyBeanOrLater())
layout = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
int visibility = (dim ? (AndroidDevices.hasCombBar()
? View.SYSTEM_UI_FLAG_LOW_PROFILE
: View.SYSTEM_UI_FLAG_HIDE_NAVIGATION)
: View.SYSTEM_UI_FLAG_VISIBLE) | layout;
mSurface.setSystemUiVisibility(visibility);
}