小编Kev*_*wig的帖子

在UITableView中的Section Header中添加填充

我创建了这个标题标题,不幸的是我不知道如何在右侧添加一些填充.

截图

这是我的代码:

override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
    let title: UILabel = UILabel()
    title.text = "Days"
    title.backgroundColor = UIColor.lightGrayColor()
    title.textAlignment = NSTextAlignment.Right
    return title
}
Run Code Online (Sandbox Code Playgroud)

header uitableview ios swift

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

标签 统计

header ×1

ios ×1

swift ×1

uitableview ×1