美文网首页
Android 占屏幕所有宽度的DialogFragment

Android 占屏幕所有宽度的DialogFragment

作者: hoffer_ | 来源:发表于2018-07-25 14:25 被阅读0次
    @Override
    public void onStart() {
        super.onStart();
        Window window = getDialog().getWindow();
        window.setDimAmount(0);
        window.setGravity(Gravity.BOTTOM);
        window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
        window.requestFeature(Window.FEATURE_NO_TITLE);
        window.setBackgroundDrawableResource(android.R.color.transparent);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle   savedInstanceState) {
        getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
        View view = LayoutInflater.from(getActivity()).inflate(R.layout.layout_local_video_list,container,false);
        return view;
    }

相关文章

网友评论

      本文标题:Android 占屏幕所有宽度的DialogFragment

      本文链接:https://www.haomeiwen.com/subject/ybppmftx.html