在 Xcode 6 中通过 Storyboard 设置 UITableView 的 contentInset
- 作者: 平道乃是神僧
- 来源: 51数据库
- 2022-10-21
问题描述
在 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
截图在这里:
推荐阅读
热点文章
检查拆分键盘
0
带有“上一个"的工具栏和“下一个"用于键盘输入AccessoryView
0
Activity 启动时显示软键盘
0
UIWebView 键盘 - 摆脱“上一个/下一个/完成"酒吧
0
在 iOS7 中边缘滑动时,使键盘与 UIView 同步动画
0
我的 iOS 应用程序中的键盘在 iPhone 6 上太高了.如何在 XCode 中调整键盘的分辨率?
0
android:inputType="textEmailAddress";- '@' 键和 '.com' 键?
0
禁用 iPhone 中键盘的方向
0
Android 2.3 模拟器上的印地语键盘问题
0
keyDown 没有被调用
0
