circle image in cell imageView and how to resize it?

后端 未结 3 931
孤街浪徒
孤街浪徒 2021-01-29 00:21

I have in a ViewController tableView with the identifier \"Cell\". This is my code:

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSInd         


        
3条回答
  •  情深已故
    2021-01-29 00:37

    You cannot change an attribute of the frame property of any view. You have to provide a totally new frame.

    cell.imageView?.frame.size.width = 100 //wont work
    

    Try doing this -

    let rect = cell.imageView?.frame;
    
    rect.size.width = 100;
    
    cell.imageView?.frame = rect; //this will work
    

提交回复
热议问题