继承自UIView的控件

network | | 访问(45)

1.1 设置控件的状态

启用、禁用

@property(nonatomic,getter=isEnabled) BOOL enabled;

选中、不选中

@property(nonatomic,getter=isSelected) BOOL selected;

高亮或者不高亮

@property(nonatomic,getter=isHighlighted) BOOL highlighted;

1.2 设置控件内容的布局

垂直居中方向

@property(nonatomic) UIControlContentVerticalAlignment contentVerticalAlignment;

水平居中方向

@property(nonatomic) UIControlContentHorizontalAlignment contentHorizontalAlignment;

1.3 添加/删除监听方法

- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents;

- (void)removeTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents;