静态 UITableViewCell 空白 - Swift,iOS 8 [英] Static UITableViewCell blank - Swift, iOS 8

查看:21
本文介绍了静态 UITableViewCell 空白 - Swift,iOS 8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Xcode 6 beta 2 和 Swift 在 UITableView 中实现一些静态单元格.我已经成功实现了动态单元格.

I am trying to implement some static cells in a UITableView using Xcode 6 beta 2 and Swift. I have successfully implemented dynamic cells.

当用户点击其中一个动态单元格时,会为带有静态单元格的 UITableView 推送到新的 UITableViewController.

When the user clicks on one of the dynamic cells there is a push segue to a new UITableViewController for a UITableView with static cells.

我已经在 Xcode 中设置了所有这些并且 segue 工作,但是当我将 UILabel 拖到一个静态单元格上时,它在运行时不显示.一些可能有助于缩小正在发生的事情的范围:

I have set this all up in Xcode and the segue works but when I drag a UILabel onto one of the static cells it just doesn't show up at run time. A few things that might help narrow down whats going on:

  1. 数据源方法没有在UITableViewController
  2. 中实现
  3. 如果我将其中一个静态单元格的背景设置为特定颜色,则会在运行时显示

非常感谢任何建议.

提前致谢

推荐答案

我相信这就是答案:

https://stackoverflow.com/a/24708004/3827274

TLDR:这是一个 Xcode 错误,将视图更改为紧凑"宽度,这似乎只影响对齐/定位.单击单元格内的 UILabel 并转到检查器一直到底部并使用已安装"或注意是否禁用默认设置.

TLDR: it's an Xcode bug with changing the view to 'compact' width which seems to only affect alignment/positioning. Click on your UILabel inside the cell and go to the inspector all the way to the bottom and play with the 'Installed' or note if the default one is disabled.

这篇关于静态 UITableViewCell 空白 - Swift,iOS 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆