1.NSKernAttributeName: @10調整字句kerning字句調整
2.NSFontAttributeName
: [UIFont systemFontOfSize:_fontSize]設置字體
3.NSForegroundColorAttributeName
:[UIColor redColor]設置文字顏色
4.NSParagraphStyleAttributeName
: paragraph設置段落樣式
5.NSMutableParagraphStyle*paragraph = [[NSMutableParagraphStyle alloc] init];
paragraph.alignment= NSTextAlignmentCenter;
6.NSBackgroundColorAttributeName:
[UIColor blackColor]設置背景顏色
7.NSStrokeColorAttributeName設置文字描邊顏色,需要和NSStrokeWidthAttributeName設置描邊寬度,這樣就能使文字空心.
NSStrokeWidthAttributeName這個屬性所對應的值是一個NSNumber對象(小數(shù))土铺。該值改變描邊寬度(相對于字體size的百分比)。默認為0,即不改變桶略。正數(shù)只改變描邊寬度想暗。負數(shù)同時改變文字的描邊和填充寬度。例如栅炒,對于常見的空心字掂摔,這個值通常為3.0。
同時設置了空心的兩個屬性赢赊,并且NSStrokeWidthAttributeName屬性設置為整數(shù)乙漓,文字前景色就無效果了
8. NSStrikethroughStyleAttributeName添加刪除線,strikethrough刪除線
9. NSUnderlineStyleAttributeName添加下劃線
10. NSShadowAttributeName設置陰影释移,單獨設置不好使叭披,必須和其他屬性搭配才好使。
和這三個任一個都好使玩讳,NSVerticalGlyphFormAttributeName涩蜘,NSObliquenessAttributeName嚼贡,NSExpansionAttributeName
11.NSVerticalGlyphFormAttributeName
該屬性所對應的值是一個NSNumber對象(整數(shù))。0表示橫排文本同诫。1表示豎排文本粤策。在iOS中,總是使用橫排文本误窖,0以外的值都未定義叮盘。
12. NSObliquenessAttributeName設置字體傾斜。Skew斜
13. NSExpansionAttributeName設置文本扁平化
UIImageView:
1.Image設置圖片霹俺,默認顯示
UIImageView*_imageView = [[UIImageViewalloc]init];
_imageView.image= [UIImageimageNamed:@"me.png"];
2.highlightedImage設置高亮狀態(tài)下顯示的圖片
_imageView.highlightedImage= [UIImageimageNamed:@"other.png"];
3.animationImages設置序列幀動畫的圖片數(shù)組
[_imageViewsetAnimationImages:[NSArrayarray]];
4.highlightedAnimationImages設置高亮狀態(tài)下序列幀動畫的圖片數(shù)組
[_imageViewsetHighlightedAnimationImages:[NSArrayarray]];
5.animationDuration設置序列幀動畫播放的時常
[_imageViewsetAnimationDuration:0.3f];
6.animationRepeatCount設置序列幀動畫播放的次數(shù)
[_imageViewsetAnimationRepeatCount:2];
7.userInteractionEnabled設置是否允許用戶交互熊户,默認不允許用戶交互
[_imageViewsetUserInteractionEnabled:YES];
8.highlighted設置是否為高亮狀態(tài),默認為普通狀態(tài)
_imageView.highlightedImage= [UIImageimageNamed:@"other.png"];
[_imageViewsetHighlighted:YES];
注意的是在highlighted狀態(tài)下設置的圖片與序列幀動畫要顯示吭服,必須同時設置UIImageView的狀態(tài)為highlighted嚷堡。