0
現在我有這樣的代碼:如何在TextView中連接具有不同文本外觀的兩個字符串?
TextView textView = (TextView) convertView.findViewById(R.id.label);
String html = name + " - <small>" + description + "</small>";
textView.setText(Html.fromHtml(html));
哪裏的TextView有android:textAppearance="?android:attr/textAppearanceLarge"
。但我需要的是<small>
的實例把文本Apparence android:textAppearance="?android:attr/textAppearanceSmall"
。我怎樣才能做到這一點?
嗨,我不明白你的目的,但你爲什麼不使用'setTextAppearance(上下文,resId)'方法直接在你的代碼中改變文本外觀? –