WCollectionAddTitlesView 0.0.3

WCollectionAddTitlesView 0.0.3

测试测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2017年2月

Wz 维护。



  • 作者
  • Wz

MacDown logo

要求

  • iOS 7+
  • Xcode 8+

安装

  • 只需将 Classes 文件夹包含到您的项目中。

用法

    WInteractCV *cv = [[WInteractCV alloc]initWithFrame:CGRectMake(0, 104, w_screen_width, w_screen_height - 20 - 40)];
    WTitleScrollView *titleView = [[WTitleScrollView alloc]initWithFrame:CGRectMake(0, 64, w_screen_width, 40) titles:@[@{@"name":@"Business"},@{@"name":@"Technology"},@{@"name":@"Science"},@{@"name":@"Health"},@{@"name":@"Sports"},@{@"name":@"Entertainment"}]];

//    titleView.titleFont = [UIFont systemFontOfSize:30];
//    titleView.highlightColor = [UIColor blackColor];
//    titleView.normalColor = [UIColor lightGrayColor];
//    [titleView setMarginsLeft:20 center:20 right:20];

    cv.combinedTitleView = titleView;

    __weak typeof(cv)weakCV = cv;

    // Add your content here.
    cv.shouldAddContentBlock = ^(NSUInteger index){
        UILabel *content = [[UILabel alloc]initWithFrame:CGRectMake(20, 200, 300, 50)];
        content.font = [UIFont systemFontOfSize:50];
        content.text = @(index).stringValue;
        [weakCV addContent:content toIndex:index];
    };

    // 
    cv.turnedPageBlock = ^(NSUInteger index){
        NSLog(@"Turned page: %@", @(index));
    };

    [self.view addSubview:titleView];
    [self.view addSubview:cv];

联系

Email: [email protected]