I have an image in my UITableView cells, but for some cells, I want not to show image, so I decided to set image height size to zero (you know I cannot use Hidden=true) because of remaining blank space.
So, I tried every thing, but I couldn't resize image, here is 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
So what should I do ?
如果将默认的UITableViewCell
与UITableViewCellStyleDefault
,则必须UITableViewCell
子类并实现layoutSubviews
方法,并在那里设置图像的框架。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.