CoordinatorLayout status bar padding disappears during fragment transactions

后端 未结 1 1583
梦谈多话
梦谈多话 2021-01-13 10:44

With the 22.2.1 Design Support Library and API 22(have not tested on earlier versions yet), I\'m running into issues with the status bar padding when switching between fragm

相关标签:
1条回答
  • 2021-01-13 11:31

    Solved it, thanks to Chris Banes.

    The problem is that it doesn't know the window insets. You have to requestApplyInsets in onViewCreated.

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        ViewCompat.requestApplyInsets(coordinatorLayout);
    }
    
    0 讨论(0)
提交回复
热议问题