iOS 7 UIDatePicker高度不一致? [英] iOS 7 UIDatePicker height inconsistency?

查看:247
本文介绍了iOS 7 UIDatePicker高度不一致?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS 7中使用带有故事板的UIDatePicker元素时,我遇到了一些奇怪的事情。在故事板中,日期选择器的固定高度为162.但实际上,元素占用的空间更多。所以这个

I'm running into something weird when using UIDatePicker elements with Storyboards in iOS 7. In the Storyboard, the date picker has a fixed height of 162. In reality, however, the element takes up more space than that. So this

变为:

因此我必须将其下方的所有内容移动,猜测并注意日期选择器实际使用的空间。这是一个错误吗?难道我做错了什么?要明确的是,日期选择器是完全透明的 - 无法找到解决方法。顶部的白色背景是主要的UIView,灰色背景是嵌入容器视图内的UITableView的背景。

so I have to move everything below it down, guessing and eyeballing how much space the date picker will actually use. Is this a bug? Am I doing something wrong? To be clear, the date picker is totally transparent - can't figure out a way around that. The white background at the top is the main UIView, and the gray background is the background of the UITableView embedded inside the container view.

推荐答案

<我可以确认在故事板中使用 UI(日期)选取器的高度(162.0)与真实(216.0)不同。因此,您必须调整容器视图的空间以适应真实日期选择器高度,或尝试使用自动布局解决它。

I can confirm that using UI(Date)Picker in storyboards has a different height (162.0) than in "reality" (216.0). Therefore you have to adjust the space to container view to fit that "real" date picker height or try to solve it using auto-layout.

这篇关于iOS 7 UIDatePicker高度不一致?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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