Android 4.4 — Translucent status/navigation bars — fitsSystemWindows/clipToPadding don't work through fragment transactions

前端 未结 8 2100
余生分开走
余生分开走 2021-01-30 11:30

When using the translucent status and navigation bars from the new Android 4.4 KitKat APIs, setting fitsSystemWindows=\"true\" and clipToPadding=\"false\"

8条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 12:07

    I have resolve this question in 4.4

    if(test){
        Log.d(TAG, "fit true ");
        relativeLayout.setFitsSystemWindows(true);
        relativeLayout.requestFitSystemWindows();
        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    }else {
        Log.d(TAG, "fit false");
        relativeLayout.setFitsSystemWindows(false);
        relativeLayout.requestFitSystemWindows();
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    }
    

提交回复
热议问题