Timmy-zzh / TDialog

DialogFragment封装,高效实现各种弹窗效果
482 stars 93 forks source link

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

Open scxingm opened 6 years ago

scxingm commented 6 years ago

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

Timmy-zzh commented 6 years ago

规划中,近期上一个版本

Timmy-zzh commented 6 years ago

已处理,请使用最新版本

scxingm commented 6 years ago

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

Timmy-zzh commented 6 years ago

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