小编gam*_*ian的帖子

UITableViewCell中的徽章视图

我想创建一个插入单元accesoryView中的badgeView.我知道过去曾经有过很多这样的问题,但那些github子类似乎已经过时,无法移植到一个快速的项目中.在快速项目中,在IOS中最简单的方法是什么?

像这样的东西:

在此输入图像描述

objective-c uitableview ios swift

17
推荐指数
3
解决办法
9323
查看次数

UITableViewCOntroller中的swift多个单元格子类

我正在尝试将多个子类添加到UITableView中.问题是它一直给我以下错误:

Type UITableVieCell does not conform to protocol NilLiteralConvertible
Run Code Online (Sandbox Code Playgroud)

的cellForRowAtIndexPath

override  func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    if indexPath.section == 0 {

        let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell

        cell.textLabel?.text = self.section1[indexPath.row]
        cell.accessoryType = .DisclosureIndicator

        return cell

    } else if indexPath.section == 1 {

        let cell = tableView.dequeueReusableCellWithIdentifier("SwitchViewCell", forIndexPath: indexPath) as SwitchViewCell

        cell.cellLabel?.text = self.section2[indexPath.row]

        return cell
    }

    return nil
}
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uitableview ios swift

7
推荐指数
3
解决办法
1万
查看次数

标签 统计

ios ×2

objective-c ×2

swift ×2

uitableview ×2

iphone ×1