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

2022-11-22移动开发问题
3

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

The End
Xcode

相关推荐

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

没有cocos2D的xcode iphone粒子
xcode iphone particles without cocos2D(没有cocos2D的xcode iphone粒子)...
2024-08-12 移动开发问题
4

Cocos2d 人像模式在 iPhone 上不起作用
Cocos2d portrait mode not working on iPhone(Cocos2d 人像模式在 iPhone 上不起作用)...
2024-08-12 移动开发问题
2

为什么 xcode 归档成功但创建一个空的 .xcarchive 文件?
Why does xcode archive succeed but create an empty .xcarchive file?(为什么 xcode 归档成功但创建一个空的 .xcarchive 文件?)...
2024-08-12 移动开发问题
2

OpenGL vs Cocos2d:选择什么?
OpenGL vs Cocos2d: What to choose?(OpenGL vs Cocos2d:选择什么?)...
2024-08-12 移动开发问题
6

移动一个精灵时所有精灵不可见
All Sprite not visible while moving one sprite(移动一个精灵时所有精灵不可见)...
2024-08-12 移动开发问题
6