Timmy-zzh / TDialog

DialogFragment封装,高效实现各种弹窗效果

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

可以支持设置view么,目前是支持设置布局id

scxingm opened this issue · comments

因为一些需求,导致设置布局id进去后不能满足需求了,希望加直接设置view的功能!!!

commented

规划中,近期上一个版本

commented

已处理,请使用最新版本

View view = LayoutInflater.from(this).inflate(R.layout.view_loading, null);
tDialog = new TDialog.Builder(getSupportFragmentManager())
.setDialogView(view)
.setCancelableOutside(false)
.create();
tDialog.show();
tDialog.dismiss();

第一次正常,第二次就崩了,是我姿势不对么 0.0
使用setLayoutRes(),没这个毛病啊 T_T

java.lang.IllegalStateException: DialogFragment can not be attached to a container view

commented

这样是不行的,LayoutInflater.from(this).inflate(R.layout.view_loading, null);这样生成的View没有父控件,设置不了LayoutParams, 你要这样用的话还不直接调用setLayoutRes()传入xml布局