Reputation: 55534
Take a UITableViewCell's imageView's frame property, attempting to set it perfectly valid (doesn't throw any errors) but has no effect, the imageView will not move.
How does Apple prevent frame's from being modified on standard UIKit components (UIImageView for example)?
I need to achieve the same in one of my projects, but I'd prefer not to subclass just to prevent write access to certain properties.
Upvotes: 1
Views: 352
Reputation: 16337
Override layoutSubviews on whatever view it is in, and set the frame there.
Upvotes: 4
Reputation:
@property (atomic, readonly) NSJonSkeet *jonSkeet;
readonly cannot be used with retain, you have to remove retain from your property if it's there.
I read your question better this time: Apple simply resets the frame when cell.imageView.image equals nil. This is to prevent whitespace in front of the textLabel and detailTextLabel. You can set its frame, but UITableViewCell simply sets it back.
Upvotes: 0