在tableview单元格swift中调整图像大小

时间:2015-02-11 04:03:01

标签: swift tableview

我一直试图让所有的tableView图像显示为相同的大小而没有运气。现在它们都是不同的尺寸。我尝试了很多选择,似乎没什么用。有谁看到了问题?提前谢谢。

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
}

0 个答案:

没有答案