相关疑难解决方法(0)

Android:获取/检索progressDialog标题的ID和DialegError标题的ID

我必须将我的项目的字体更改为外部的,我几乎无处不在,现在只有它缺少ProgressDialog和ErrorDialeg的标题(正文也被更改).

那么我在两种情况下都做了什么(由于Exception而发表了文本视图):

        String msg1 = "one", msg2 = "two";

        progressDialog = ProgressDialog.show(activity, msg1, msg2, true);
        Typeface font=Typeface.createFromAsset(activity.getAssets(),"fonts/rockwell.ttf");

        TextView text = (TextView)progressDialog.findViewById(android.R.id.message);
        text.setTypeface(font);

        //text = (TextView)progressDialog.findViewById(android.R.id.title);
        text.setTypeface(font);
Run Code Online (Sandbox Code Playgroud)

和:

    ..........
    AlertDialog dialog = new AlertDialog.Builder(a)
        .setTitle( titol )
        .setMessage( cos )
    ..........
        .show();

     //Establir el canvi de font a la personalitzada.
     Typeface font=Typeface.createFromAsset(a.getAssets(),"fonts/rockwell.ttf");
     TextView textView = (TextView)dialog.findViewById(android.R.id.message);
     textView.setTypeface(font);
     //textView =  (TextView)dialog.findViewById(android.R.id.title);
     textView.setTypeface(font);
     textView =  (TextView)dialog.findViewById(android.R.id.button1);
     textView.setTypeface(font);
Run Code Online (Sandbox Code Playgroud)

我已经尝试了所有可能的选项(不仅是'R.id.title')而且我只有异常试图在两种情况下都获得TITLE TextView.这是我需要改变整个项目字体的最后一件事.如果有人知道在哪里获得标题...提前谢谢.

android progressdialog typeface

1
推荐指数
1
解决办法
2839
查看次数

标签 统计

android ×1

progressdialog ×1

typeface ×1