182,UIButton继承UIControl,UIControl中常用的属性和方法

//UIButton 继承 UIContorl 中的方法和属性说明:

// 1,设置按钮状态

//按钮启用或禁用

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

//按钮选中或不选中

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

//按钮高亮或不高亮

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


//2,设置按钮文字的对齐方式

//纵向居中对齐方式

@property(nonatomic) UIControlContentVerticalAlignment contentVerticalAlignment;

//横向居中对齐方式

@property(nonatomic) UIControlContentHorizontalAlignment contentHorizontalAlignment;


//3,设置或取消监听事件

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

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


你可能感兴趣的:(IOS之UI)