首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在iOS 9中,uitableview页脚文本对齐/间距发生了变化,我该怎么办?

在iOS 9中,uitableview页脚文本对齐/间距发生了变化,我该怎么办?
EN

Stack Overflow用户
提问于 2015-10-21 23:21:06
回答 1查看 454关注 0票数 1

嘿。

下面这两张图片显示了发生了什么变化。这是我的代码,代码没有改变。

代码语言:javascript
复制
- (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)之后的视图,间隙是关闭的。空间太大了。

那么,有人知道为什么会发生这种情况吗?如果谁有什么好办法,请告诉我!

提前感谢!

EN

回答 1

Stack Overflow用户

发布于 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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33263163

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档