Swift 在tableview单元格中调整图像大小
我一直在尝试让所有的tableView图像显示为相同的大小,但在swift中没有运气。现在它们都是不同尺寸的。我尝试了很多选择,但似乎没有任何效果。有人看到问题了吗?提前谢谢Swift 在tableview单元格中调整图像大小,swift,tableview,Swift,Tableview,我一直在尝试让所有的tableView图像显示为相同的大小,但在swift中没有运气。现在它们都是不同尺寸的。我尝试了很多选择,但似乎没有任何效果。有人看到问题了吗?提前谢谢 func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { var cell = myTable.dequeueReusableCellWithIdentif
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
var cell = myTable.dequeueReusableCellWithIdentifier("MyCell", forIndexPath: indexPath) as UITableViewCell
cell.textLabel.text = colleges[indexPath.row].name
cell.detailTextLabel?.text = colleges[indexPath.row].location
cell.imageView.image = colleges[indexPath.row].image
cell.imageView.frame = CGRectMake(0, 0, 40, 40)
return cell
}
查看子类化
UITableViewCell
和重写-layoutSubviews
或重写-didDisplayCellForRowAtIndexPath