你能改变UIDatePicker的字体大小吗? [英] Can you change the font size of a UIDatePicker?

查看:169
本文介绍了你能改变UIDatePicker的字体大小吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我有几个UIDatePickers,我需要占用大约2/3的屏幕。但是,当前这样做时,月份和年份列在纵向时会被截断。例如,代替2015,您将看到......或9月......而不是9月。我已经找到了如何缩放和缩小选择器,但这似乎根本没有解决问题。

In my application, I have several UIDatePickers that I need to take up about 2/3 of the screen. However, doing so currently, the month and year columns are getting truncated when in portrait. For example, instead of "2015" you'll see "..." or "Sept..." instead of "September." I've found how to scale and shrink the picker, but that doesn't seem to be fixing the problem at all.

所以我想知道你是否可以改变它列的字体大小。这是我能想到的唯一方法,让所有列都不能自己控制。当Apple已经提供具有相同功能的东西时,这看起来非常不必要并且容易出现更多错误。但如果这是唯一的方法..

So I was wondering if you could change the font size of the columns. That's the only way I can think of to allow all of the columns to fit short of making my own control. Which would seem incredibly unnecessary and prone to more errors when Apple already provides something with the same functionality. But if that's the only way..

推荐答案

不幸的是,没有: https://developer.apple.com/library/ ios / documentation / UserExperience / Conceptual / UIKitUICatalog / UIDatePicker.html#// apple_ref / doc / uid / TP40012857-UIDatePicker-SW3

另一种选择是使用UIPickerView制作您自己的版本: http://codewithchris.com/uipickerview-example/

An alternative would be to make your own version using UIPickerView: http://codewithchris.com/uipickerview-example/

这篇关于你能改变UIDatePicker的字体大小吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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