文章来源:淘论文网   发布者: 毕业设计   浏览量: 48



还可以点击去查询以下关键词:
[较为]    [美观]    [定制]    [展开]    [列表]    [较为美观的多定制级展开列表]   

项目介绍:

          先看界面

较为美观的多定制级展开列表


较为美观的多级展开.gif

一级列表主要用的自定义的UITableViewHeaderFooterView,二级列表和三级列表则利用自定义的cell。该控件可以扩展第四级,第五级等,但需要修改代码以及数据源,论文,这个可以自己参考代码修改。
界面代码较为简单,开题报告,这里就不展示了,展示主要的代码。
记录展开的核心代码    func expandNodes(section : Int, parentID:String,index:Int)->Int{                var insertindex = index                for i in 0..<companys[section].subNodes.count {            let node = companys[section].subNodes            //找到父节点是parentID的子节点            if node.parentID == parentID {                if !self.preservation {  //是否保留所有子cell的展开状态                    node.expand = false                }                //展开节点的后面+1的位置                insertindex += 1                //根据展开顺序排列                tempNodes[section].insert(node, at: insertindex)                //存储插入的位置                reloadArray.append(IndexPath(row: insertindex, section: section))                //遍历子节点的子节点进行展开                if node.expand {                    insertindex = expandNodes(section : section, parentID: node.ownID, index: insertindex)                }            }        }        return insertindex    }记录收起的数据func foldNodes(section : Int,level:Int,currentIndex:Int){        if currentIndex+1<tempNodes[section].count {                        let tempArr = NSArray(array: tempNodes[section])                        let startI = currentIndex+1            var endI   = currentIndex            for i in (currentIndex+1)..<(tempArr.count) {                let node = tempArr as! MLNodelObj                if node.level <= level {                    break                }else{                    endI += 1                    reloadArray.append(IndexPath(row: i, section: section))                }            }            if endI >= startI {                tempNodes[section].removeSubrange(startI...endI)            }        }    }github地址:https://github.com/ljmkimqx/LJMMultiLevelTableView



这里还有:


还可以点击去查询:
[较为]    [美观]    [定制]    [展开]    [列表]    [较为美观的多定制级展开列表]   

请扫码加微信 微信号:sj52abcd


下载地址: http://www.taolw.com/down/5169.docx
  • 上一篇:一个可以横向和定制纵向布局的视图
  • 下一篇:时间日期选择器WSDatePicker