iOS 7 的重新设计导致UITableViewCells. 单元格的内容视图被包装在一个名为 的私有类中UITableViewCellScrollView。
在 iOS 7UITableViewCellScrollView中已clipsToBounds设置为YES并UITableViewCellContentView已clipToBounds设置为NO.
在 iOS 7.1UITableViewCellScrollView中已clipsToBounds设置为NO并UITableViewCellContentView已clipToBounds设置为 NO。
如果您[[self contentView] setClipsToBounds:YES]在 iOS 7.1 中调用,它会粘住吗?在单元格 UITableViewCellContentView 上调用 layoutSubviews 时,clipToBounds 再次设置为 NO。
[[self contentView] superview] setClipsToBounds:YES]在 iOS 7.1 中工作并将 UITableViewCellScrollView 的 clipToBounds 设置为 YES 但这是一个非常脆弱的解决方案。
覆盖单元格上的 layoutSubview 并调用[[self contentView] setClipsToBounds:YES]有效,但这是另一个脆弱的解决方案。
有谁知道为什么要进行此更改以及更强大的解决方案?