Skip to content

这是一个SegmentControl 支持自动滑动到中间 并且有点击事件

License

Notifications You must be signed in to change notification settings

ZhangRuixiang/RRRSegment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RRRSegment

这是一个SegmentControl

支持自动滑动到中间

并且有点击事件

直接上图:

使用方法

 RRRSegment *segment = [[RRRSegment alloc] initWithFrame:CGRectMake(0, 80, SCREEN_WIDTH, 30)];
    
    segment.backgroundColor = [UIColor orangeColor];
    segment.selectedTextColor = [UIColor redColor];
    segment.isShowUnderline = YES;
    
    segment.tapItemWithIndex = ^(NSInteger index,BOOL animation){
        
        NSLog(@"****点击了第%ld个 item****",(long)index);

    };
    
    [self.view addSubview:segment];
    
    NSMutableArray *arr = [NSMutableArray array];
    for (int i = 0; i < 10; i ++) {
        
        [arr addObject:[NSString stringWithFormat:@"item%d",i]];
        
    }
    segment.titleArray = [NSArray arrayWithArray:arr];
 

About

这是一个SegmentControl 支持自动滑动到中间 并且有点击事件

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published