Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 1 KB

README.md

File metadata and controls

29 lines (19 loc) · 1 KB

LHSlideViewsDemo

UICollectionView 实现简单带标签栏滚动控件

image

使用方法

   //初始化数据 datasourse
   NSMutableArray *titleArray = [[NSMutableArray alloc]initWithObjects:@"全部",@"语文",@"数学",@"英语",@"物理",@"化学",@"生物",@"政治",@"历史",@"地理",@"学法", nil];
   NSMutableArray *pageViewsArray = [NSMutableArray new];

   // 获取内容数据
   for (int i = 0; i<titleArray.count; i++)
   {
       UIViewController *pageVC = [UIViewController new];
       pageVC.view.backgroundColor = [self randomColor];
    
      [pageViewsArray addObject:pageVC];
   }
   
   // 初始化 slideViews
   self.slideViews.titles = titleArray;
   self.slideViews.pagesViews = pageViewsArray;
   [self.slideViews reloadData];

标签栏试着改成 UICollectionView 来实现,也许会好点 =。=