iOS--drawInRect:withFont等方法在iOS7.0後背棄用,代替方法drawInRect:withAttributes用法(轉載)
paragraph.alignment = NSTextAlignmentCenter;
NSParagraphStyleAttributeName:paragraph 設置段落樣式
需要和NSStrokeWidthAttributeName設置描邊寬度,這樣就能使文字空心.
同時設置了空心的兩個屬性,並且NSStrokeWidthAttributeName屬性設置爲整數,文字前景色NSForegroundColorAttributeName就無效果了。
NSUnderlineColorAttributeName:[UIColor blueColor] 下劃線顏色
9.
NSShadow *shadow = [[NSShadow alloc] init];
shadow.shadowColor = [UIColor grayColor];
shadow.shadowBlurRadius = 2;
shadow.shadowOffset = CGSizeMake(2, 4);
NSShadowAttributeName:shadow 設置陰影
NSVerticalGlyphFormAttributeName:@0 該屬性所對應的值是一個 NSNumber 對象(整數)。
0 表示橫排文本。1 表示豎排文本。
在 iOS 中,總是使用橫排文本,0 以外的值都未定義。
NSObliquenessAttributeName:@1 設置字體傾斜
NSExpansionAttributeName:@1 設置文本扁平化