自定义背景透明度的全屏dialog

1、在styles.xml里加上


2、建一个DialogFragment

public class BaseDialogFragment extends DialogFragment {
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setStyle(DialogFragment.STYLE_NO_TITLE, R.style.dialog_fullscreen);

    }

@Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    //自定义布局
       return  inflater.inflate(R.layout.dialog_share, null);
      }
}

你可能感兴趣的:(自定义背景透明度的全屏dialog)