I have a subclassed UITableViewCell.
I need to dynamically change the frame of a UILabel.
Here\'s what I\'ve done:
- (UITableViewCell *)table
Well a few days after posting the bounty I've found the answer, I hope this will help someone someday...
I am not 100% sure why, but what I tried to do simply can not be done:
You cannot change the frame of an object if you've put it through Interface Builder.
To make the changes I wanted to do, I simply created those objects programmatically in my subclass, inside "initWithCoder".
content = [[UILabel alloc] initWithFrame:CGRectMake(120, 100, 200, 50)];
content.opaque = NO;
content.numberOfLines = 0;
[self.contentView addSubview:content];
I was then able to change the frames inside "- (void)layoutSubviews" (but basically anywhere I wanted)
- (void)layoutSubviews
{
[super layoutSubviews];
[cell.Content setFrame:CGRectMake(0, 0, 10, 10)];
...