在UITableView中将UITableViewCell垂直居中 [英] Vertically center UITableViewCell in UITableView

查看:168
本文介绍了在UITableView中将UITableViewCell垂直居中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当只有一个或两个单元格时,如何将一个单元格垂直放置在UITableViewCell中? Apple在编辑日期时经常在其应用程序中(例如在设置"应用程序中)执行此操作.

How would you go about centering a cell vertically in a UITableViewCell when there's only one or two cells? Apple does this quite often in their apps, for example in the Settings app, when editing the date.

这是一个例子:

推荐答案

我会考虑在其上方放置一个透明的大UITableViewCell(这是您如何在gitHubby中使用用户的信息,但没有数据).

I'd consider putting a large, transparent UITableViewCell above it (ala how you do it in gitHubby with the user's info, but with no data).

那是具有480像素高的好处.您可以放进固定大小的东西,然后就可以使用了.

thats the benefit of have 480 pixels high. you can put something in, fixed size, and it'll JUST WORK.

或者放入一个\ n \ n \ n包含节标题,它也是不可见和透明的.

Or put a \n\n\n containing section header in, which is also invisible and transparent.

哦,对于Spy ++或用于运行iOS应用的东西:)

oh for Spy++ or something for running iOS apps :)

这篇关于在UITableView中将UITableViewCell垂直居中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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