您的位置:首页 > 移动开发 > Swift

swift下完成tableviewCell的注册创建

2016-08-25 15:42 337 查看
直接上代码

//这里是用xib创建cell的

 messageTableView.registerNib(UINib.init(nibName: "MessageCell", bundle: nil), forCellReuseIdentifier: "MessageCell")

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {

        return 18

    }

    

    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

        let cell = tableView.dequeueReusableCellWithIdentifier("MessageCell")

        

        return cell!

        

    }

    func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {

        return 70

    }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios swift
相关文章推荐