ios - How to resize UIImageView in Swift -


I have an image in my UITableView cells, but for some cells, I do not want to show the image, so I decided The size of the image height due to the remaining space is zero (you know that I can not use hidden = true.

So, I tried everything, but I did not resize the image So, here's my code, so how to resize?

 Cell! .imageImage.layer.frame = CGRectMake (0, 0, 0, 0) cell! .imageImage.layer.masksToBounds = true  

I also tried:

 Cell! .imageImage.frame = CGRectMake (0, 0, 0, 0 ) Cell! .imageImage.layer.masksToBounds = true  

then what should I do?

If you are using the default UITableViewCell with UITableViewCellStyleDefault , you must subclass the UITableViewCell and layoutSubviews method must be implemented, and there the image frame must be set.


Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

c# - WPF Expander overlay used in ItemsControl -

class - Kivy: how to instantiate a dynamic classes in python -