The iOS 7 redesign resulted in change of the view hierarchy of UITableViewCells
. The content view of the cell was wrapped in a private class called UITableViewCellScrollView
.
In iOS 7 UITableViewCellScrollView
has clipsToBounds
set to YES
and UITableViewCellContentView
has clipToBounds
set to NO
.
In iOS 7.1 UITableViewCellScrollView
has clipsToBounds
set to NO
and UITableViewCellContentView
has clipToBounds
set to NO.
If you call [[self contentView] setClipsToBounds:YES]
in iOS 7.1 is does it stick. By the time layoutSubviews is called on the cell UITableViewCellContentView has clipToBounds set to NO again.
[[self contentView] superview] setClipsToBounds:YES]
works in iOS 7.1 and sets UITableViewCellScrollView's clipToBounds to YES but this is a very brittle solution.
Overriding layoutSubview on the cell and calling [[self contentView] setClipsToBounds:YES]
works but is another fraile solution.
Does anyone know why this change has been made and a more robust solution to it?