Board logo

标题: HMSegmentedControl源代码解析(4) [打印本页]

作者: look_w    时间: 2019-2-19 17:35     标题: 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




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0