是否可以为TextView中的不同文本设置多个样式?
例如,我将文本设置如下:
tv.setText(line1 + "\n" + line2 + "\n" + word1 + "\t" + word2 + "\t" + word3);
Run Code Online (Sandbox Code Playgroud)
是否可以为每个文本元素设置不同的样式?例如,line1粗体,word1斜体等.
开发人员指南的常见任务和Android中的操作方法包括选择,突出显示或设置部分文本样式:
Run Code Online (Sandbox Code Playgroud)// Get our EditText object. EditText vw = (EditText)findViewById(R.id.text); // Set the EditText's text. vw.setText("Italic, highlighted, bold."); // If this were just a TextView, we could do: // vw.setText("Italic, highlighted, bold.", TextView.BufferType.SPANNABLE); // to force it to use Spannable storage so styles can be attached. // Or we could specify that in the XML. // …
我有一个TextView,其间有一个巨大的文本我有一个泰米尔语单词,我知道如何在单独的textview中嵌入泰米尔字体.但我需要英语单词之间的泰米尔语请提前帮助谢谢
我在textview中的部分文字:
Kolam使用了欢迎(நல்வரவு)等季节性消息.当一个奉献者的时候,有时候会在寺庙里做志愿者去画kolam