How to change the ProgressDialog Message font size in android programmatically?

前端 未结 3 2088
谎友^
谎友^ 2021-02-06 18:00

I have used progressDialog in my android application and i have used code as

ProgressDialog progressDialog = new ProgressDialog(this);
        progressDialog.se         


        
3条回答
  •  粉色の甜心
    2021-02-06 18:31

    Change the ProgressDialog Message font size in android programmatically:

    String s= "Hello";
    String title="MyTitle";
    
    SpannableString ss1=  new SpannableString(title);
    ss1.setSpan(new RelativeSizeSpan(2f), 0, ss1.length(), 0);  
    ss1.setSpan(new ForegroundColorSpan(Color.RED), 0, ss1.length(), 0); 
    SpannableString ss2=  new SpannableString(s);
    ss2.setSpan(new RelativeSizeSpan(2f), 0, ss2.length(), 0);  
    ss2.setSpan(new ForegroundColorSpan(Color.GREEN), 0, ss2.length(), 0); 
    
    ProgressDialog pd = new ProgressDialog(this);
    pd.setTitle(ss1);
    pd.setMessage(ss2);
    pd.show();
    

提交回复
热议问题