巴扎黑2017-04-17 16:20:00
Transparency is achievable,
Window window = getWindow();
// 状态栏透明
window.setFlags(
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// 虚拟导航栏透明
window.setFlags(
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
You need to check the version, which is only available after 4.4.
The corresponding activity layout needs to add the following attribute to the layout root node.
android:fitsSystemWindows="true"
PHP中文网2017-04-17 16:20:00
getWindow().setNavigationBarColor() can set the color of the bottom navigation bar
getWindow().setStatusBarColor() can set the color of the top status bar
If you want the layout to extend to the navigation bar or status bar, refer to the 1L settings
The bottom navigation bar is designed to add buttons...