【发布时间】:2021-12-20 02:12:36
【问题描述】:
我有一个 BottomSheetDialog 类,当我们单击按钮时会显示,我需要让它全屏而不是页面上的一半。
public class BottomSheetDialogBuyPlan extends BottomSheetDialog {
public BottomSheetDialogBuyPlan(@NonNull Context context) {
super(context);
BottomSheetBehavior<FrameLayout> behavior = getBehavior();
behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
View bottomSheet = getLayoutInflater().inflate(R.layout.layout, null);
setContentView(bottomSheet);
show();
}
@Override
public void setOnShowListener(@Nullable OnShowListener listener) {
super.setOnShowListener(listener);
}
}
这就是我在活动中的称呼
BottomSheetDialogBuyPlan bottomSheetDialog = new
BottomSheetDialogBuyPlan(getContext());
如何让它全屏显示?
【问题讨论】:
-
不工作这是bottomsheetdialogfragment不是bottomsheetdialog!!
标签: android android-bottomsheetdialog