So I just tried subclassing UITableViewHeaderFooterView
and aligning the labels the way I want by overriding -layoutSubviews
.
When I call super
and change a label's frame
, however, the app appears to be stuck in an infinite -layoutSubviews
loop.
My code looks like this:
- (void)layoutSubviews
{
[super layoutSubviews];
self.textLabel.frame = CGRectMake(10.0, 10.0, 300.0, 40.0);
}
Any ideas on how to fix this?
A reusable view that you place at the top or bottom of a table section to display additional information for that section.
It seems an attempt to modify the frame of backgroundView
or contentView
not only causes an infinite loop, it will ignore any values you set to their frames, rendering their existence fairly useless. I've reverted to using the backgroundView
and contentView
as dumb containers for my own custom subviews with their own background visuals and layout properties. :S
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With