Is it possible to set the color of a string directly in string.xml?

前端 未结 12 1026
轮回少年
轮回少年 2021-02-07 12:17

I mean something like:

Error!
12条回答
  •  醉话见心
    2021-02-07 12:34

    Strings.xml

    Select %1$s brand or scan the Remote
    

    class.java

    String SelectedDeviceType_Str = "TV"
    
    SetupYourDevice_TextView.setText(Html.fromHtml(String.format(Html.toHtml(new SpannedString(getResources().getText(R.string.pbs_setup_title))),
                        SelectedDeviceType_Str)));
    

提交回复
热议问题