更改状态栏模式导致 MI6 startFragment() 返回空白页面

作者: A-Heavy-Rain创建于 2018年5月18日更新于 2023年7月4日

Running environment

  • Device model: e.g. Mi6
  • Device system version: Android 8.0
  • Gradle version: 3.1.2
  • QMUI Android version: 1.1.2
  • QMUI arch version: 0.1.0

Specific problem description

addDrawerListener(new DrawerLayout.DrawerListener() { @Override public void onDrawerSlide(@NonNull View drawerView, float slideOffset) { if (slideOffset > 0) { QMUIStatusBarHelper.setStatusBarLightMode(getActivity()); } else { QMUIStatusBarHelper.setStatusBarDarkMode(getActivity()); } } I mainly want to change the color of the status bar text when the side bar is opened, so that the time and other related information on the status bar can be clearly seen. However, when I call this method, if (slideOffset > 0) { QMUIStatusBarHelper.setStatusBarLightMode(getActivity()); } else { QMUIStatusBarHelper.setStatusBarDarkMode(getActivity()); }, the next fragment that appears after startFragment() becomes blank on my Xiaomi 6. However, there is no problem on Huawei Mate 9.

Problem screenshot

2 kk7lp 65usk v_c 1w

内容来源: Tencent/QMUI_Android