UIButton(UIButtonExtend) Category Reference

Declared in TuSDKICView+Extend.h

Overview

按钮帮助类

+ buttonWithFrame:imageName:

初始化

+ (instancetype)buttonWithFrame:(CGRect)frame imageName:(NSString *)imageName

Parameters

frame

坐标长宽

imageName

图片名称

Return Value

button 按钮对象

Declared In

TuSDKICView+Extend.h

+ buttonWithFrame:backgroundImageName:

初始化

+ (instancetype)buttonWithFrame:(CGRect)frame backgroundImageName:(NSString *)imageName

Parameters

frame

坐标长宽

imageName

背景图片名称

Return Value

button 按钮对象

Declared In

TuSDKICView+Extend.h

+ buttonWithFrame:backgroundImageName:title:capInsets:font:

初始化

+ (instancetype)buttonWithFrame:(CGRect)frame backgroundImageName:(NSString *)imageName title:(NSString *)title capInsets:(UIEdgeInsets)capInsets font:(UIFont *)font

Parameters

frame

坐标长宽

imageName

背景图片名称

title

标题文字

capInsets

图片拉伸区域

font

字体

Return Value

button 按钮对象

Declared In

TuSDKICView+Extend.h

+ buttonWithFrame:title:font:color:

初始化

+ (instancetype)buttonWithFrame:(CGRect)frame title:(NSString *)title font:(UIFont *)font color:(UIColor *)color

Parameters

frame

坐标长宽

title

标题文字

font

字体

color

颜色

Return Value

button 按钮对象

Declared In

TuSDKICView+Extend.h

– setTitle:backgroundImageName:capInsets:

设置属性

- (void)setTitle:(NSString *)title backgroundImageName:(NSString *)imageName capInsets:(UIEdgeInsets)capInsets

Parameters

title

标题文字

imageName

背景图片名称

capInsets

图片拉伸区域

Declared In

TuSDKICView+Extend.h

– setStateNormalTitle:

设置默认状态标题文字

- (void)setStateNormalTitle:(NSString *)title

Parameters

title

标题文字

Declared In

TuSDKICView+Extend.h

– setStateNormalTitleColor:

设置默认状态标题颜色

- (void)setStateNormalTitleColor:(UIColor *)color

Parameters

color

颜色

Declared In

TuSDKICView+Extend.h

– setStateNormalTitleShadowColor:

设置默认状态标题阴影颜色

- (void)setStateNormalTitleShadowColor:(UIColor *)color

Parameters

color

颜色

Declared In

TuSDKICView+Extend.h

– setStateNormalImage:

设置默认状态图片

- (void)setStateNormalImage:(UIImage *)image

Parameters

image

图片

Declared In

TuSDKICView+Extend.h

– setStateNormalImageName:

设置默认状态图片

- (void)setStateNormalImageName:(NSString *)name

Parameters

name

图片名称

Declared In

TuSDKICView+Extend.h

– setStateNormalBackgroundImage:

设置默认状态背景

- (void)setStateNormalBackgroundImage:(UIImage *)image

Parameters

image

背景图片

Declared In

TuSDKICView+Extend.h

– setStateNormalBackgroundImageName:

设置默认状态背景图片名称

- (void)setStateNormalBackgroundImageName:(NSString *)imageName

Parameters

imageName

背景图片名称

Declared In

TuSDKICView+Extend.h

– setStateNormalBackgroundImageName:capInsets:

设置默认状态背景

- (void)setStateNormalBackgroundImageName:(NSString *)imageName capInsets:(UIEdgeInsets)capInsets

Parameters

imageName

背景图片名称

capInsets

图片拉伸区域

Declared In

TuSDKICView+Extend.h

– setStateNormalAttributedTitle:

设置默认状态标题属性

- (void)setStateNormalAttributedTitle:(NSAttributedString *)title

Parameters

title

标题属性

Declared In

TuSDKICView+Extend.h

– setStateNormalBackgroundImageColor:

设置默认状态图片背景色

- (void)setStateNormalBackgroundImageColor:(UIColor *)color

Parameters

color

背景色

Declared In

TuSDKICView+Extend.h

– setBackgroundImageColor:forState:

设置可以触发事件的背景色

- (void)setBackgroundImageColor:(UIColor *)imageColor forState:(UIControlState)state

Parameters

imageColor

背景色

state

事件状态

Declared In

TuSDKICView+Extend.h

– addTouchUpInsideTarget:action:

添加范围内点击事件

- (void)addTouchUpInsideTarget:(id)target action:(SEL)action

Parameters

target

目标对象

action

动作

Declared In

TuSDKICView+Extend.h

– centerImageAndTitle:

垂直居中图片和标题

- (void)centerImageAndTitle:(float)space

Parameters

space

图片和标题间距

Declared In

TuSDKICView+Extend.h