首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

HMSegmentedControl源代码解析(2)

HMSegmentedControl源代码解析(2)

@property (nonatomic, strong) NSArray<NSString *> *sectionTitles; // section标题
@property (nonatomic, strong) NSArray<UIImage *> *sectionImages;  // section图片
@property (nonatomic, strong) NSArray<UIImage *> *sectionSelectedImages; // 选中的section图片

/**
Provide a block to be executed when selected index is changed.

Alternativly, you could use `addTarget:action:forControlEvents:`
*/

/**
选中index之后的回调
可以使用`addTarget:action:forControlEvents:`替代
*/
@property (nonatomic, copy) IndexChangeBlock indexChangeBlock;

/**
Used to apply custom text styling to titles when set.

When this block is set, no additional styling is applied to the `NSAttributedString` object returned from this block.
*/

/**
自定义富文本标题
*/
@property (nonatomic, copy) HMTitleFormatterBlock titleFormatter;

/**
Text attributes to apply to item title text.
*/

/**
标题 text 属性
*/
@property (nonatomic, strong) NSDictionary *titleTextAttributes UI_APPEARANCE_SELECTOR;

/*
Text attributes to apply to selected item title text.

Attributes not set in this dictionary are inherited from `titleTextAttributes`.
*/
@property (nonatomic, strong) NSDictionary *selectedTitleTextAttributes UI_APPEARANCE_SELECTOR;

/**
Segmented control background color.

Default is `[UIColor whiteColor]`
*/

/**
背景颜色
*/
@property (nonatomic, strong) UIColor *backgroundColor UI_APPEARANCE_SELECTOR;

/**
Color for the selection indicator stripe

Default is `R:52, G:181, B:229`
*/
/**
指示器颜色
*/
@property (nonatomic, strong) UIColor *selectionIndicatorColor UI_APPEARANCE_SELECTOR;

/**
Color for the selection indicator box

Default is selectionIndicatorColor
*/

/**
box颜色
*/
返回列表