模态底部工作表显示全屏活动中的导航栏

问题描述 投票:0回答:1

我在FullScreen活动中实现了模态底部片段片段。问题是,当我显示片段时,会出现导航栏。这是我显示片段的代码:

OptionsFragment optionsFragment=OptionsFragment.newInstance();
optionsFragment.show(getSupportFragmentManager(),"options_fragment");

这是片段:

public class OptionsFragment extends BottomSheetDialogFragment {


    public OptionsFragment() {
    }

    public static OptionsFragment newInstance() {
        OptionsFragment fragment = new OptionsFragment();
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.options_layout,container,false);
        return view;
    }

}

最后,这就是我在活动开始时隐藏工具栏和导航栏的方法:

mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE
                | View.SYSTEM_UI_FLAG_FULLSCREEN
                | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
                | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
android android-layout bottom-sheet
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.