2017-09-01 87 views

回答

1

如圖所示here,您可以使用AttributedString作爲軸標籤。指定WEIGHT_SEMIBOLD以獲得「比WEIGHT_REGULAR稍重的重量」。

AttributedString as = new AttributedString(s); 
… 
as.addAttribute(TextAttribute.WEIGHT, TextAttribute.WEIGHT_SEMIBOLD, 0, 1); 
as.addAttribute(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD, 1, 2); 

在這個例子中,字符a具有WEIGHT_SEMIBOLD

WEIGHT_SEMIBOLD

在這個例子中,字符a具有WEIGHT_BOLD

WEIGHT_BOLD

作爲參考,AttributedString用於以下內容: