ios - navigationBar 和 tableview 单元格之间的间距

标签 ios swift uitableview uikit uistoryboard

如何在 navigationBar 和第一个 UITableViewCell 之间添加间距?

enter image description here

最佳答案

您需要将 contentInset 添加到您的 UITableView 第一个值用于 top inset 第二个值用于 left 第三个值用于 bottom 和最后一个 right

像这样

self.tableView.contentInset = UIEdgeInsetsMake(10, 0, 0, 0) //replace 10 by your needed value

关于ios - navigationBar 和 tableview 单元格之间的间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48873169/

相关文章:

ios - 将 RSA 私钥加载到 EVP_PKEY

Swift 3 viewWillTransitionToSize 未被调用

ios - iOS 7 UITableViewCell 中与 AutoLayout 冲突的约束

ios - 使用 appium 自动化 IOS UITableview

swift - 关闭 tableviewcontroller 中 uitableviewcell 中文本字段的键盘 - Swift

ios - 设置 UIFont 粗细

ios - WebAudio 在 iOS7/iPad 上不播放并延迟加载进度

ios - 如何将多选 UITableView 值添加到 objective-c 中的 UITextField

swift - 您的规范来源均不包含满足依赖项 : `Yoga (= 0.45.0.React)` 的规范

Xcode 7 UI 测试循环遍历所有开关