美文网首页
多层级条目展示表

多层级条目展示表

作者: 苍茫的天涯 | 来源:发表于2018-09-17 11:21 被阅读82次

关于如何展示多栏目多个条目多个cell多个collectioncell的展示类似下面这种情况

1536909708079.jpg

像这种比较复杂的样式,里面涵盖了SegmentTitleView UITableView UICollectionView 这几种类型,基本的层级关系是

SegmentTitleView 包含 SegmentTitleView 包含 UITableView
包含 UICollectionView 这样的样式

关于SegmentTitleView的使用可以直接参考 iOS自定义一个仿网易左右滑动切换页面框架

///默认选择
@property (nonatomic,assign) NSInteger defaultSelect;
@property (nonatomic, strong) FSSegmentTitleView *titleView;
///当前控制器
@property (nonatomic ,strong) UIViewController *currentVC;
@property (nonatomic, strong) NSMutableArray<UIViewController *> *childVCs;
self.titles = @[@"全部基金",@"自选基金"];

self.titleView = [[FSSegmentTitleView alloc]initWithFrame:CGRectMake(0, 0, self.titles.count*100, 40) titles:self.titles delegate:self indicatorType:FSIndicatorTypeNone];
    self.titleView.indicatorExtension = 6;
    self.titleView.selectIndex = _defaultSelect;
    self.titleView.titleFont = [UIFont systemFontOfSize:15];
    self.titleView.titleSelectFont = [UIFont boldSystemFontOfSize:15];
    self.titleView.titleNormalColor = RGBCOLOR(253, 149, 137);
    self.titleView.titleSelectColor = [UIColor whiteColor];
    self.navigationItem.titleView = self.titleView;
//  切换各个标签内容
- (void)replaceController:(UIViewController *)oldController newController:(UIViewController *)newController
{
    /**
     *            着重介绍一下它
     *  transitionFromViewController:toViewController:duration:options:animations:completion:
     *  fromViewController      当前显示在父视图控制器中的子视图控制器
     *  toViewController        将要显示的姿势图控制器
     *  duration                动画时间(这个属性,old friend 了 O(∩_∩)O)
     *  options                 动画效果(渐变,从下往上等等,具体查看API)
     *  animations              转换过程中得动画
     *  completion              转换完成
     */
    [self.view addSubview:newController.view];
    [newController.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
    [self addChildViewController:newController];
    if (![[UIApplication sharedApplication] isIgnoringInteractionEvents]) {
        [[UIApplication sharedApplication] beginIgnoringInteractionEvents];
    }

    [self transitionFromViewController:oldController toViewController:newController duration:0.2 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
    } completion:^(BOOL finished) {
        if (finished) {
            [newController didMoveToParentViewController:self];
            [oldController willMoveToParentViewController:nil];
            [oldController removeFromParentViewController];
            self.currentVC = newController;
        }else{
            self.currentVC = oldController;
        }
        if ([[UIApplication sharedApplication] isIgnoringInteractionEvents]){
            [[UIApplication sharedApplication] endIgnoringInteractionEvents];
        }
        
    }];
}


#pragma mark FSSegmentTitleViewDelegate
- (void)FSSegmentTitleView:(FSSegmentTitleView *)titleView startIndex:(NSInteger)startIndex endIndex:(NSInteger)endIndex
{
    // childVC里放置的是对应的那些子页面的VC
    UIViewController *newVC = self.childVCs[endIndex];
    [self replaceController:self.currentVC newController:newVC];
}

这就是第一层的titleVC的基本展示了,接下来第二层titleview的配置也参照第一层,但是要相应的改变titles的数量。这里就不过多赘述了

相关文章

  • 多层级条目展示表

    关于如何展示多栏目多个条目多个cell多个collectioncell的展示类似下面这种情况 像这种比较复杂的样式...

  • 在GridControl表格控件中实现多层级主从表数据的展示

    在一些应用场景中,我们需要实现多层级的数据表格显示,如常规的二级主从表数据展示,甚至也有多个层级展示的需求,那么我...

  • 详解Android RecyclerView

    目录 点击事件 添加、删除数据 更丰富的条目展示(多条目展示) 添加header 、footer 下拉刷新、上拉加...

  • Android RecyclerView 多条目展示

    用RecyclerView来实现这个多种不同的Item的加载。 依赖: implementation 'andro...

  • MacOS开发 | NSOutlineView基于Cell Ba

    在我们进行开发的时候,想要展示一组层级结构的数据时,可以使用NSOutlineView来对层级结构的数据进行展示,...

  • Android RecyclerView 效果之树形折叠效果

    项目中遇到类似,省/市/县/乡/村 这种多层级数据展示的效果.原先处理过两层或者多层数据嵌套展示,没有处理过这种多...

  • 一款很好用的笔记工具

    WorkFlowy WorkFlowy按照层级建立条目,归档资料的过程,就像建立书籍的目录一样。这样最大的好处在整...

  • GOT表覆写技术

    GOT表:概念:每一个外部定义的符号在全局偏移表(Global offset Table)中有相应的条目,GOT位...

  • Region详解

    1 层级结构 Table (HBase 表) Region(表的Regions)Store(Region中以列族为...

  • 金融App_同花顺交互分析

    一、用户行为地图 金融软件具有很大的特殊性,层级结构复杂、操作繁琐、信息展示量大、安全考量多、行业资讯新闻丰富、实...

网友评论

      本文标题:多层级条目展示表

      本文链接:https://www.haomeiwen.com/subject/jnpogftx.html