UI: 表视图

1,表视图

减一,就可以了

好好理解表视图

一个Session 里面的 第一个Cell 不一样,是 ScrollView


    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        
        if mainModel.data?.banner?.count > 0{
        
        if indexPath.row == 0 {
            
            let bannerModels = self.mainModel.data?.banner
            
            
            let cell = FPageBannerCell.createBannerCellForTableView(tableView, atIndexPath: indexPath, withModels: bannerModels! )
            
            return cell
        }else{
//        }else if indexPath.row > 0{
        
        
        
                let cellId = "pageFirst"
                var cell = tableView.dequeueReusableCellWithIdentifier(cellId) as? FirstPageCell
                if cell == nil {        
                    cell = NSBundle.mainBundle().loadNibNamed("FirstPageCell", owner: nil, options: nil).last as? FirstPageCell
                }
                let model = self.mainModel.data?.dinnerList![indexPath.row-1]
                    //不是第一个,自然要 减去。             这里是减1
                   
                cell?.configurateModel(model!)
                return cell!
                }
                
//        }
        }
        return UITableViewCell()
        
    }



2,ScrollView

nib

应该放一张ScrollView

IDE提示 ,NSLayoutConstraint。
我说,怎么滑不动了。

我甩了一张ImageView,老师问我,我还说要放ImageView。

好好理解,容器视图。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容