底部重力对话框动画在api kitkat上方的导航栏上?

Chr*_*ist 6 animation android dialog navigationbar

我必须显示带有动画的底部对话框,因为我使用了以下代码.

 View view = getLayoutInflater().inflate(R.layout.layout_picker_bottom_sheet, null);
            Dialog mBottomSheetDialog = new Dialog(this, R.style.MaterialDialogSheet);
            mBottomSheetDialog.setContentView(view);
            mBottomSheetDialog.setCancelable(true);
            mBottomSheetDialog.getWindow().setLayout(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
            mBottomSheetDialog.getWindow().setGravity(Gravity.BOTTOM);
            mBottomSheetDialog.show();  
Run Code Online (Sandbox Code Playgroud)

对话风格

 <!-- Bottom sheet style-->
    <style name="MaterialDialogSheet" parent="@android:style/Theme.Dialog">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:backgroundDimEnabled">true</item>
        <item name="android:windowIsFloating">false</item>
        <item name="android:windowAnimationStyle">@style/MaterialDialogSheetAnimation</item>
    </style>

 <!-- Animation-->
    <style name="MaterialDialogSheetAnimation">
        <item name="android:windowEnterAnimation">@anim/popup_show</item>
        <item name="android:windowExitAnimation">@anim/popup_hide</item>
    </style>
Run Code Online (Sandbox Code Playgroud)

并且它运行良好,但在进入时与导航栏重叠windowEnterAnimation并且在动画后放置在所需位置,没有任何问题.

如何在进入时从导航栏启动对话框动画而不重叠?

你可以看到它正确放置下方的UI,但是当它出来时它会动画导航.

在此输入图像描述