ios - NSAutoLayout, View , 表格 View

标签 ios objective-c uitableview ios-autolayout autolayout

我正在开发一个客户端应用程序,它的屏幕有一个顶 View 和一个 uitableview。我是 iOS 和 NSAutoLayout 的新手,我使用了 xcode 推荐的设置,最后在界面生成器中得到了这样的东西 Interface Builder Screen shot

但是当我在模拟器中运行它时,我得到一个奇怪的空间来分隔 tableview 和顶 View ,就像这样

simulator screen shot

这个空间是从哪里来的?我该如何解决这个问题?

更新:

tblview 有一个限制,基本上是 height = 500。这可能是问题所在吗?我可以让它更有活力吗?我毕竟是新手,使用了 xcode 推荐的任何东西!

最佳答案

一些事情:

set leding, trailing n bottom pins for tbleview to 2.

set verticl spcing between tbleview nd custom view to 2.

set leding, trailing n top pins for custom view to 2.

set verticl spcing from custom view to bottom lyout to 548.

屏幕截图: XIB

然后在模拟器上运行: enter image description here

希望对你有帮助

编辑 只需选择自定义导航 View 并通过从可用的 3 个选项中选择第二个菜单选项来添加图钉。

将有一个复选标记“边距”,只需取消选中它即可。选择左右和底部并添加约束。

从 iPhone 开发者输入中回答真的很痛苦

关于ios - NSAutoLayout, View , 表格 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33851000/

相关文章:

ios - 代码 : Can you add a Storyboard midway through development

iOS IBM Bluemix 推送通知服务器假装

ios - 如何在 Xcode 中使用 UIViewController 的共享实例?

ios - 在 iOS 中取消付款?

iphone - 更改 View 大小后 tableview 消失

ios - 根据每个单元格的内容动态调整具有多个 UITableViewCells 时的高度

iOS:使用 NSNotificationCenter 在 userInfo 中发布代码块?

ios - 在 Core Data 中只有一个实体实例

ios - 使用和不使用图像动态调整 TableViewCell 的大小

objective-c - 使用多个 NSSortDescriptor 有效地对数组中的对象进行排序