ProgressDialog
我可以知道是否可以在 内更改消息显示的字体DialogFragment
?
public class LoadFromCloudTaskFragment extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
this.progressDialog = new ProgressDialog(this.getActivity());
this.progressDialog.setMessage(progressMessage);
this.progressDialog.setCanceledOnTouchOutside(false);
return progressDialog;
}
通过继承创建自定义类ProgressDialog
可能是其中一种方式。但是,我想知道有没有更好的选择?可悲的是,我们没有ProgressDialog.Builder
.
我尝试过的一种选择是
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
this.progressDialog = new ProgressDialog(this.getActivity());
this.progressDialog.setMessage(progressMessage);
this.progressDialog.setCanceledOnTouchOutside(false);
Utils.setCustomFont(this.progressDialog.findViewById(android.R.id.message), Utils.ROBOTO_LIGHT_FONT);
return progressDialog;
}
但这会给我错误
android.util.AndroidRuntimeException: requestFeature() 必须在添加内容之前调用