华为系统BottomSheetDialog或DialogFragment底部弹出,Edittext键盘部分遮盖
- 键盘底部遮盖现象
以BottomSheetDialog为例
查看BottomSheetDialog.java源码使用的是
Theme.Design.Light.BottomSheetDialog这个themestyle.xml中继承Theme.Design.Light.BottomSheetDialog
<style name="BottomSheetEdit" parent="Theme.Design.Light.BottomSheetDialog">
<item name="android:windowIsFloating">false</item>
</style>
- 在自己的MyBottomDialogFragment的onCreate中加入
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(DialogFragment.STYLE_NORMAL, R.style.BottomSheetEdit);
}
- 修正后效果图