Danpe Danpe - 1 year ago 141
Objective-C Question

Access iOS 7 hidden UITableViewCellScrollView?

Apple change the

hierarchy in iOS 7

Using iOS 6.1 SDK

| <UITableViewCellContentView>
| | <UILabel>

Using iOS 7 SDK

| <UITableViewCellScrollView>
| | <UITableViewCellContentView>
| | | <UILabel>

My problem is that the
UITableViewCellScrollView.layer.masksToBounds = TRUE
by default and i need it to be false.

I tried the following:

UIView * scrollView = [self.subviews objectAtIndex:0];
scrollView.layer.masksToBounds = NO;


[self.myLabel.superview.layer setMasksToBounds:NO];

But non of them changes the
How can i access this scrollview?

Answer Source

The only way to access the new CellScrollView is by accessing the cell superview after it was created.

I added the following cellForRowAtIndexPath:

cell = [[UICustomTableViewCell alloc] init];
UIView *cellScrollView = cell.myLabel.superview;
[cellScrollView.layer setMasksToBounds: NO];

I think Apple should give us a way to access this new ScrollView without hacking.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download