您的位置:首页 > 其它

DialogFragment使用细节

2016-07-06 10:12 302 查看
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//全屏
setStyle(DialogFragment.STYLE_NORMAL, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
}

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
Dialog dialog = getDialog();
if (dialog == null) {
return null;
}
//去标题并
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
//设置背景透明
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));

View view = inflater.inflate(R.layout.dialog_share, container, false);
ButterKnife.bind(this, view);
return view;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: