Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 在tableview单元格中调整图像大小_Swift_Tableview - Fatal编程技术网

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

Swift 在tableview单元格中调整图像大小,swift,tableview,Swift,Tableview,我一直在尝试让所有的tableView图像显示为相同的大小,但在swift中没有运气。现在它们都是不同尺寸的。我尝试了很多选择,但似乎没有任何效果。有人看到问题了吗?提前谢谢 func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { var cell = myTable.dequeueReusableCellWithIdentif

我一直在尝试让所有的tableView图像显示为相同的大小,但在swift中没有运气。现在它们都是不同尺寸的。我尝试了很多选择,但似乎没有任何效果。有人看到问题了吗?提前谢谢

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