Setting a UITableView#39;s contentInset through Storyboard in Xcode 6(在 Xcode 6 中通过 Storyboard 设置 UITableView 的 contentInset)
问题描述
在 Xcode 6 上,似乎已经取消了通过 UIStoryboard 设置滚动视图/表格视图的内容插入的功能.见下图:
On Xcode 6, it seems that the ability to set the content inset of a scroll view/table view through UIStoryboard has been taken away. See image below:
左边的参数来自 Xcode 6,右边的参数来自 Xcode 5
the parameters on the left are from Xcode 6, whereas the parameters on the right are from Xcode 5
有谁知道参数是否已经移动,或者我们不再能够通过 UIStoryboard 设置内容插图?如果可能的话,我真的很想把它排除在我的代码之外..
Does anyone know if the parameters have moved, or are we no longer able to set the content inset through UIStoryboard? I'd really like to keep this out of my code if possible..
推荐答案
你可以通过使用 KVC 来做到这一点
You can do that by using KVC
- 选择表格视图
- 选择身份检查员
- 在用户定义的运行时属性"中按+"
- 将您的插图添加为 Rect {{10,15},{25,10}} 用于 KeyPath contentInset
- Select table view
- Choose Identity Inspector
- Press "+" in "User defined runtime attributes"
- Add your inset as a Rect {{10,15},{25,10}} for KeyPath contentInset
截图在这里:
这篇关于在 Xcode 6 中通过 Storyboard 设置 UITableView 的 contentInset的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Xcode 6 中通过 Storyboard 设置 UITableView 的 conte


基础教程推荐
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01