在 Xcode 6 中通过 Storyboard 设置 UITableView 的 contentInset

Setting a UITableView#39;s contentInset through Storyboard in Xcode 6(在 Xcode 6 中通过 Storyboard 设置 UITableView 的 contentInset)
本文介绍了在 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

  1. 选择表格视图
  2. 选择身份检查员
  3. 在用户定义的运行时属性"中按+"
  4. 将您的插图添加为 Rect {{10,15},{25,10}} 用于 KeyPath contentInset
  1. Select table view
  2. Choose Identity Inspector
  3. Press "+" in "User defined runtime attributes"
  4. Add your inset as a Rect {{10,15},{25,10}} for KeyPath contentInset

截图在这里:

这篇关于在 Xcode 6 中通过 Storyboard 设置 UITableView 的 contentInset的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
Resume game cocos2d(恢复游戏 cocos2d)
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
[ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)
Storing and reading files from Documents directory iOS 5(从 Documents 目录存储和读取文件 iOS 5)
How can I implement a virtual joystick for a cocos2d game outside the cocos2d environment?(如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?)