【发布时间】:2015-08-27 20:46:20
【问题描述】:
我想让我的按钮更宽一些,下面是我正在尝试的代码:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("secondItemTableCell") as! SecondItemTableViewCell
cell.docentBtn.setTitle(data[subjects[indexPath.section]]![indexPath.row], forState: UIControlState.Normal)
println(cell.docentBtn.frame)
cell.docentBtn.frame = CGRectMake(cell.docentBtn.frame.origin.x, cell.docentBtn.frame.origin.y, cell.docentBtn.frame.width + 20.0, cell.docentBtn.frame.height)
cell.docentBtn.layer.cornerRadius = cell.docentBtn.frame.height / 2
cell.docentBtn.clipsToBounds = true
println(cell.docentBtn.frame)
return cell
}
输出:
(8.0, 5.0, 49.0, 34.0)
(8.0, 5.0, 69.0, 34.0)
但视觉上没有任何变化。有人可以帮我看看有什么问题吗?
【问题讨论】:
-
您的问题与此问题重复stackoverflow.com/questions/27205771/…
标签: ios swift uitableview uibutton frame