Mev
Mev

Reputation: 1625

UITableViewCell resizing won't affect touch area

I have UITableView where cells are taken from UITableViewCell created with Interface Builder (xib) file.

The problem is the touch area of the cell is unaffected regardless of the cell's frame. Is there a way to fix this ?

How do I fix this ? Here is a log from layoutSubviews method inside UITableViewCell class.

Code

- (void)layoutSubviews
{
    NSLog(@"pre frame > %@ ",NSStringFromCGRect(self.contentView.frame));
    [super layoutSubviews];
    NSLog(@"post frame > %@ ",NSStringFromCGRect(self.contentView.frame));
}

Output

pre frame > {{0, 0}, {748, 62}} // before calling [super layoutSubviews]
post frame > {{0, 0}, {1004, 62}} // after calling [super layoutSubviews]

* * Update * *

I could not figure out patching this code up due to deadlines & hence I re created the xib file from scratch (For the big container view that included UITableView not the UITableViewCell) and the problem seemed to have gone away. Thanks everyone who tried to help.

Upvotes: 1

Views: 389

Answers (1)

stosha
stosha

Reputation: 2148

Make sure all super views (from tableview to self.window.rootViewController in app delegate) changed frame size to landscape too.

Upvotes: 1

Related Questions