Autoresizing subclassed UITableViewCell subviews
Posted
by JustinXXVII
on Stack Overflow
See other posts from Stack Overflow
or by JustinXXVII
Published on 2010-04-27T15:23:01Z
Indexed on
2010/04/27
15:23 UTC
Read the original article
Hit count: 499
I've subclassed UITableViewCell and incorporated some subviews via the layoutSubviews method. All views are allocated and initiated in the initWithStyle method, and frames are set in the layoutSubviews method, like so:
initWithStyle:... {
UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectZero];
myLabel.someProperties = Configured;
[self.contentView addSubview:myLabel];
layoutSubviews {
CGRect labelRect = CGRectMake(10.0f, 5.0f, 35.0f, 180.0f);
myLabel.frame = labelRect;
Setting the shouldAutoRotateOrientation to YES in the viewController rotates the NavigationController, tableView and UIToolbar appropriately, but the contents of the tableViewCells don't move. I'm not clear on where or what to add as far as AutoResizingMasks. The combinations I've tried so far haven't done anything. Can someone give me a hand?
Thanks!
© Stack Overflow or respective owner