text
@property(nullable, nonatomic,copy) NSString *text; // default is nil
@property(null_resettable, nonatomic,strong) UIFont *font; // default is nil (system font 17 plain)
@property(null_resettable, nonatomic,strong) UIColor *textColor; // default is nil (text draws black)
@property(nullable, nonatomic,strong) UIColor *highlightedTextColor; // default is nil
// the underlying attributed string drawn by the label, if set, the label ignores the properties above.
@property(nullable, nonatomic,copy) NSAttributedString *attributedText NS_AVAILABLE_IOS(6_0); // default is nil
shade
@property(nullable, nonatomic,strong) UIColor *shadowColor; // default is nil (no shadow)
@property(nonatomic) CGSize shadowOffset; // default is CGSizeMake(0, -1) -- a top shadow
state
// the 'highlight' property is used by subclasses for such things as pressed states. it's useful to make it part of the base class as a user property
@property(nonatomic,getter=isHighlighted) BOOL highlighted; // default is NO
@property(nonatomic,getter=isUserInteractionEnabled) BOOL userInteractionEnabled; // default is NO
@property(nonatomic,getter=isEnabled) BOOL enabled; // default is YES. changes how the label is drawn
override UIView
UILabel继承自UIView,override以下属性默认值:
- userInteractionEnabled default NO
- clipToBounds default YES
- contentMode default UIViewContentModeRedraw