启动时设置状态栏为沉浸式,避免某些机型沉浸式无效的问题
This commit is contained in:
@@ -57,6 +57,15 @@ public class StatusBar extends CordovaPlugin {
|
||||
// Clear flag FLAG_FORCE_NOT_FULLSCREEN which is set initially
|
||||
// by the Cordova.
|
||||
Window window = cordova.getActivity().getWindow();
|
||||
// 添加的内容开始
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
window.addFlags(WindowManager.LayoutParams
|
||||
.FLAG_TRANSLUCENT_NAVIGATION);
|
||||
window.addFlags(WindowManager.LayoutParams
|
||||
.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
||||
window.setStatusBarColor(Color.TRANSPARENT);
|
||||
window.setNavigationBarColor(Color.TRANSPARENT);
|
||||
// 添加的内容结束
|
||||
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
||||
|
||||
// Read 'StatusBarBackgroundColor' from config.xml, default is #000000.
|
||||
|
||||
Reference in New Issue
Block a user