常用方法
- 新增一個(gè)文字segment
- (void)insertSegmentWithTitle:(nullable NSString *)title atIndex:(NSUInteger)segment animated:(BOOL)animated;
- 新增一個(gè)圖片segment
- (void)insertSegmentWithImage:(nullable UIImage *)image atIndex:(NSUInteger)segment animated:(BOOL)animated;
- 刪除某個(gè)segment
- (void)removeSegmentAtIndex:(NSUInteger)segment animated:(BOOL)animated;
- 刪除所有segment
- (void)removeAllSegments;
- 設(shè)置某個(gè)segment標(biāo)題
- (void)setTitle:(nullable NSString *)title forSegmentAtIndex:(NSUInteger)segment;
- 獲取某個(gè)segment標(biāo)題
- (nullable NSString *)titleForSegmentAtIndex:(NSUInteger)segment;
- 設(shè)置某個(gè)segment圖片
- (void)setImage:(nullable UIImage *)image forSegmentAtIndex:(NSUInteger)segment;
- 獲取某個(gè)segment圖片
- (nullable UIImage *)imageForSegmentAtIndex:(NSUInteger)segment;
- 設(shè)置某個(gè)segment寬度
- (void)setWidth:(CGFloat)width forSegmentAtIndex:(NSUInteger)segment;
- 獲取某個(gè)segment寬度
- (CGFloat)widthForSegmentAtIndex:(NSUInteger)segment;
- 設(shè)置segment內(nèi)容偏移量
- (void)setContentOffset:(CGSize)offset forSegmentAtIndex:(NSUInteger)segment;
- 獲取某個(gè)segment內(nèi)容偏移量
- (CGSize)contentOffsetForSegmentAtIndex:(NSUInteger)segment;
- 設(shè)置某個(gè)segment是否可用,默認(rèn)為
YES
- (void)setEnabled:(BOOL)enabled forSegmentAtIndex:(NSUInteger)segment;
- 獲取某個(gè)segment是否可用
- (BOOL)isEnabledForSegmentAtIndex:(NSUInteger)segment;
- 設(shè)置背景圖
- (void)setBackgroundImage:(nullable UIImage *)backgroundImage forState:(UIControlState)state barMetrics:(UIBarMetrics)barMetrics
- 設(shè)置分隔線圖片
- (void)setDividerImage:(nullable UIImage *)dividerImage forLeftSegmentState:(UIControlState)leftState rightSegmentState:(UIControlState)rightState barMetrics:(UIBarMetrics)barMetrics NS_AVAILABLE_IOS(5_0)
- 獲取分隔線圖片
- (nullable UIImage *)dividerImageForLeftSegmentState:(UIControlState)leftState rightSegmentState:(UIControlState)rightState barMetrics:(UIBarMetrics)barMetrics
- 設(shè)置標(biāo)題富文本屬性
- (void)setTitleTextAttributes:(nullable NSDictionary *)attributes forState:(UIControlState)state NS_AVAILABLE_IOS(5_0)
- 獲取富文本屬性
- (void)setTitleTextAttributes:(nullable NSDictionary *)attributes forState:(UIControlState)state NS_AVAILABLE_IOS(5_0)