分页标题+内容显示控件封装使用说明

分页标题控件

效果图:

=========================================

功能:

· 根据数据源动态显示标题数量、长度、下横线长度

· 可以根据需求自定义风格
=========================================

   Demo地址:https://github.com/liujunwei2018/PageTitleView

可以根据个人需求进行样式修改

 

使用代码示例:(在项目中导入 demo 中的 views 文件夹,在控制器实例化)

ViewController1 *vc1 = [[ViewController1 alloc] init];

vc1.title = @"首页";

 ViewController2 *vc2 = [[ViewController2 alloc] init];

 vc2.title = @"游戏";

 ViewController3 *vc3 = [[ViewController3 alloc] init];

 vc3.title = @"分类";

 ViewController4 *vc4 = [[ViewController4 alloc] init];

 vc4.title = @"热门";

 NSArray *viewControllers = @[vc1, vc2, vc3, vc4];

 PageView *pageView = [[PageView alloc] initWithFrame:CGRectMake(0, 64, self.view.bounds.size.width,      self.view.bounds.size.height) pageTitleViewHeight:40 childViewControllers:viewControllers];

    [self.view addSubview:pageView];

猜你喜欢

转载自blog.csdn.net/ljw2017/article/details/83053857