嘿。
下面这两张图片显示了发生了什么变化。这是我的代码,代码没有改变。
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
{
if (section == 0) {
return @"If enabled, closing apps via the app switcher won't actually close the app itself.\n\nThis option is perfect to use with Fast Freeze.";
}
NSString *offDescription = @"OFF\nDisables the backgrounding capability completely. The app has to restart every time you close it.";
NSString *fastFreezeDescription = @"FAST FREEZE\nThis mode is similar to what 'Smart Close' by rpetrich did. Usually an app has up to 10 minutes to perform tasks in the background before it gets suspended in memory. Since this can be an unnecessary battery drain, Fast Freeze will suspend the app right after you close it.";
NSString *nativeDescription = @"NATIVE\nThis is Apple's built in way of backgrounding.";
NSString *unlimitedNativeDescription = @"UNLIMITED NATIVE\nThis background mode allows apps to execute background tasks for an unlimited period of time, so the app won't get suspended in memory after 10 minutes.";
NSString *foregroundDescription = @"FOREGROUND\nForeground tricks the system into thinking that the app wasn't closed and is still running in foreground. This is the perfect way to continue to listen to internet streams or videos while using another app.";
return [NSString stringWithFormat:@"\n%@\n\n%@\n\n%@\n\n%@\n\n%@", offDescription, fastFreezeDescription, nativeDescription, unlimitedNativeDescription, foregroundDescription];
}截图如下:

这是之前的视图(iOS 8),请注意“\nOFF\n禁用...”与上一个UITableViewCell之间的差距应该是这样的。

这是(iOS 9)之后的视图,间隙是关闭的。空间太大了。
那么,有人知道为什么会发生这种情况吗?如果谁有什么好办法,请告诉我!
提前感谢!
发布于 2015-10-29 23:40:30
这似乎是苹果的一个bug (iOS 9.0 - 9.1),页脚的行数越多,错误的位置就越大。
您甚至可以使用静态表视图在故事板中重现它。

我还没有找到任何解决办法,我能给出的最好的建议是给file a bug report to Apple.
更新
故事板中的错误似乎在Xcode7.2测试版2中得到了修复。然而,当你在iOS 9.2模拟器上运行应用程序时,这个问题仍然存在。
更新2
缩小了这个bug的重现范围。基本上,在你的应用程序显示一个表视图节标题后,就会有一些东西中断。有关详细信息,请查看this repo。
https://stackoverflow.com/questions/33263163
复制相似问题