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

HMSegmentedControl源代码解析(4)

HMSegmentedControl源代码解析(4)

**
分割线是否显示
*/
@property(nonatomic, getter = isVerticalDividerEnabled) BOOL verticalDividerEnabled;

/**
Index of the currently selected segment.
*/

/**
选中的标号
*/
@property (nonatomic, assign) NSInteger selectedSegmentIndex;

/**
Height of the selection indicator. Only effective when `HMSegmentedControlSelectionStyle` is either `HMSegmentedControlSelectionStyleTextWidthStripe` or `HMSegmentedControlSelectionStyleFullWidthStripe`.

Default is 5.0
*/

/**
指示器高度
*/
@property (nonatomic, readwrite) CGFloat selectionIndicatorHeight;

/**
Edge insets for the selection indicator.
NOTE: This does not affect the bounding box of HMSegmentedControlSelectionStyleBox

When HMSegmentedControlSelectionIndicatorLocationUp is selected, bottom edge insets are not used

When HMSegmentedControlSelectionIndicatorLocationDown is selected, top edge insets are not used

Defaults are top: 0.0f
             left: 0.0f
           bottom: 0.0f
            right: 0.0f
*/
@property (nonatomic, readwrite) UIEdgeInsets selectionIndicatorEdgeInsets;

/**
Inset left and right edges of segments.

Default is UIEdgeInsetsMake(0, 5, 0, 5)
*/
@property (nonatomic, readwrite) UIEdgeInsets segmentEdgeInset;

@property (nonatomic, readwrite) UIEdgeInsets enlargeEdgeInset;

/**
Default is YES. Set to NO to disable animation during user selection.
*/
@property (nonatomic) BOOL shouldAnimateUserSelection;

//初始化
- (id)initWithSectionTitlesNSArray<NSString *> *)sectiontitles;
- (id)initWithSectionImagesNSArray<UIImage *> *)sectionImages sectionSelectedImagesNSArray<UIImage *> *)sectionSelectedImages;
- (instancetype)initWithSectionImagesNSArray<UIImage *> *)sectionImages sectionSelectedImagesNSArray<UIImage *> *)sectionSelectedImages titlesForSectionsNSArray<NSString *> *)sectiontitles;
- (void)setSelectedSegmentIndexNSUInteger)index animatedBOOL)animated;
- (void)setIndexChangeBlockIndexChangeBlock)indexChangeBlock;
- (void)setTitleFormatterHMTitleFormatterBlock)titleFormatter;

@end
返回列表