如何将iPhone UIDatePicker设置为24小时模式而不影响其他应用程序?

发布于 2024-09-11 22:36:14 字数 304 浏览 2 评论 0原文

我的用户在我的 iPhone 应用程序中使用 24 小时制而不是 AM/PM 12 小时制时钟来选择时间。目前,据我所知,将 UIDatePicker 置于 24 小时时间模式的唯一方法是通过设备设置。我的用户只想要此应用程序的 24 小时模式,而不是他们的整个设备。

有谁知道如何将 UIDatePicker 置于仅适用于我的应用程序的 24 小时时钟模式?

谢谢。

PS 当我的应用程序启动时,是否有可能将设备置于 24 小时模式,然后当应用程序进入后台或关闭时,将设备设置恢复为原来的方式?我想知道该应用程序是否可以在使用时控制设备设置?

My users was to select their times using the 24 HR clock instead of the AM/PM 12 hour clock in my iPhone app. Presently, as far as I can tell, the only way to put the UIDatePicker into 24 HR time mode is from the device's settings. My users only want 24 HR mode for this app, not their entire device.

Does anyone know a way to put the UIDatePicker into 24 HR clock mode for my app only?

Thank you.

P.S. Would it be possible when my app starts it would put the device into 24 HR mode and then when the app goes to the background or closes it sets the device settings back to the way it was? I wonder if the app can control the device settings while it's used?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沐歌 2024-09-18 22:36:14

这是不可能的,希望将来可以实现。我创建了自己的日期/时间输入,以便通过 UITextField 实现这一点。

It can't be done, hopefully this will be available in the future. I created my own date/time input to make this possible via a UITextField.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文