Setting a UITableView's contentInset through Storyboard in Xcode 6

半城伤御伤魂 提交于 2019-12-19 05:13:09

问题


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:

the parameters on the left are from Xcode 6, whereas the parameters on the right are from Xcode 5

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..


回答1:


You can do that by using KVC

  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

Screenshot here:



来源:https://stackoverflow.com/questions/25207927/setting-a-uitableviews-contentinset-through-storyboard-in-xcode-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!