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。
我说,怎么滑不动了。