UILabel头文件常见属性

  • text : default is nil 文本属性,默认值是 nil
@property(nullable, nonatomic,copy) NSString *text;          
  • font : default is nil (system font 17 plain) 字体属性,默认系统17号字体
@property(null_resettable, nonatomic,strong) UIFont *font;                     
  • textColor : default is nil (text draws black) 文本颜色属性,默认黑色
@property(null_resettable, nonatomic,strong) UIColor *textColor;       
  • shadowColor : default is nil (no shadow) 阴影属性,默认没有阴影
@property(nullable, nonatomic,strong) UIColor *shadowColor;      
  • shadowOffset : default is CGSizeMake(0, -1) -- a top shadow 阴影偏移位置,默认顶部位置有1个点的阴影
@property(nonatomic) CGSize shadowOffset;     
  • textAlignment : default is NSTextAlignmentLeft 文本对齐方式,默认左对齐。(取值为枚举)
@property(nonatomic) NSTextAlignment textAlignment;     
  • attributedText : 可在设置文字时,同时设置文字的属性内容,包括字体,颜色等。
@property(nullable, nonatomic,copy)   NSAttributedString *attributedText NS_AVAILABLE_IOS(6_0);   
  • highlighted : default is NO 是否高亮,默认状态 NO
@property(nonatomic,getter=isHighlighted) BOOL highlighted;  
  • highlightedTextColor : default is nil,高亮状态时文本颜色。 默认 nil
@property(nullable, nonatomic,strong) UIColor *highlightedTextColor; 
  • userInteractionEnabled : default is NO 是否可以跟用户交互,默认 NO
@property(nonatomic,getter=isUserInteractionEnabled) BOOL userInteractionEnabled;  
  • enabled : default is YES. changes how the label is drawn 是否是可用状态,默认YES,可以改变标签如何绘制
@property(nonatomic,getter=isEnabled) BOOL enabled;     
  • numberOfLines : 文本显示的行数。0是无限行
@property(nonatomic) NSInteger numberOfLines;   
  • adjustsFontSizeToFitWidth : default is NO。调整字体的大小以适应标签的大小。默认不调整。
@property(nonatomic) BOOL adjustsFontSizeToFitWidth;    
原文地址:https://www.cnblogs.com/sleepingSun/p/5329161.html