Open shannona opened 13 years ago
Are you sure the bug isn't perhaps just with UITextField's sizeThatFits: implementation? UILabel, etc. are all UIView subclasses as well.
On Oct 7, 2011, at 1:33 PM, shannona wrote:
The accessoryView in tables is limited to UILabels and other classes that respond meaningfully to sizeThatFits: . If you instead try to use a UIView child, such as UITextField, the accessory ends up writing right over the main label because sizeThatFits: in UIView just returns the size that it's given.
It's the layoutSubviews method in UITableViewCell that does the wrong thing.
(Under iOS, a UIView in an accessoryView instead behaves as expected.)
Reply to this email directly or view it on GitHub: https://github.com/BigZaphod/Chameleon/issues/69
UILabel has its own sizeThatFits: method, which is why it works. UITextField (and UITextView, which I also tested), just drop back to UIView's default method.
Whether the problem is the UIView method (return size;), that UITextField and UITextView don't have their own method, or that layoutSubviews does the wrong thing, I don't actually know--just that the behavior is different under iOS.
Ok. Likely the real problem is that UITextView/UITextField don't have a sizeThatFits: implementation. Investigation will be necessary.
On Oct 7, 2011, at 2:40 PM, shannona wrote:
UILabel has its own sizeThatFits: method, which is why it works. UITextField (and UITextView, which I also tested), just drop back to UIView's default method.
Whether the problem is the UIView method, that UITextField and UITextView don't have their own method, or that layoutSubviews does the wrong thing, I don't actually know--just that the behavior is different under iOS.
Reply to this email directly or view it on GitHub: https://github.com/BigZaphod/Chameleon/issues/69#issuecomment-2327133
When I thought about it more, that's what made the most sense to me too.
The accessoryView in tables is limited to UILabels and other classes that respond meaningfully to sizeThatFits: . If you instead try to use a UIView child, such as UITextField, the accessory ends up writing right over the main label because sizeThatFits: in UIView just returns the size that it's given.
It's the layoutSubviews method in UITableViewCell that does the wrong thing.
(Under iOS, a UIView in an accessoryView instead behaves as expected.)