UIButton *onlyPriceBtn = [UIButton buttonWithType:UIButtonTypeCustom]; onlyPriceBtn.layer ...
轉自:http: my.oschina.net CarlHuang blog 在項目開發中,我們經常會遇到在這樣一種情形:在一個UILabel 使用不同的顏色或不同的字體來體現字符串,在iOS 以后我們可以很輕松的實現這一點,官方的API 為我們提供了UILabel類的attributedText, 使用不同顏色和不同字體的字符串,我們可以使用NSAttributedText 和 NSMutabl ...
2014-02-15 14:34 0 82398 推薦指數:
UIButton *onlyPriceBtn = [UIButton buttonWithType:UIButtonTypeCustom]; onlyPriceBtn.layer ...
顯示不同的字體,需要設置其 attributedText屬性 該屬性是NSMutableAttrib ...
1、UILabel字體加粗 IOS 加粗; [UILabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:20]]; 加粗並且傾斜 [UILabel setFont:[UIFont fontWithName ...
//協議 UILabel *xieLabel = [[UILabel alloc] init]; xieLabel.textColor = TextGrayColor; xieLabel.font = [UIFont systemFontOfSize:12 ...
iOS7以后系統提供了顯示html標簽的方法 直接上代碼 代碼效果 ...
NSAttributedString的初始化方法有: -initWithString:用String初始化,並沒有Attributed信息。 -initWit ...
讓UILabel的內容豎行顯示,我經常用一下兩種方式: 第一種:使用換行符 \n 第二種:使用lineBreakMode屬性 其他的屬性設置,可以參考我寫的那篇《UILabel全屬性》 ...