As I updated an app of mine from iOS6 to iOS7 I noticed that where in iOS6 cell content was allowed to cross outside of a cell when the clipsToBounds property is set to NO on the cells view or contentView, iOS7 seems to disable this even when the overall view, tableview, cell and cellcontent clipsToBounds are all set as NO. You can see a sample of this in the included images. The first is test code running on iOS6, and the second is the same code running on iOS7:
Does anyone know how to fix this issue? I'm guessing it's just a one-line fix, but I've spent several hours on this with no luck. To avoid a major rewrite and headaches I'd, but playing around with the view, tableview, cell and cellcontent clipsToBounds has been fruitless - all are set to NO still on iOS7, so I'm not sure what is happening differently.
You can see and download the sample project at: https://github.com/Jon-Schneider/ClipsToBoundsTest
Thanks!
It looks like the view hierarchy changed slightly in iOS 7 for table view cells.
You can try setting the clips to bounds on the contentView's superview:
[cell.contentView.superview setClipsToBounds:NO];
If you add the following to your sample code and run on ios7 vs ios6, you'll see there's an additional view between the cell view and content view:
[cell.contentView.superview setClipsToBounds:NO]; NSLog(@"%@", cell.contentView.superview); NSLog(@"%@", cell.contentView.superview.superview); NSLog(@"%@", cell); if (self.view.clipsToBounds) { NSLog(@"Master clips"); } else { NSLog(@"Master no clip"); }
You may made chang in the tableview attributes inspector of Clip Subviews.
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