在Xcode 6中通过Storyboard设置UITableView的contentInset [英] Setting a UITableView's contentInset through Storyboard in Xcode 6

查看:119
本文介绍了在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. 选择Identity Inspector

  3. 按 +in用户定义的运行时属性

  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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆