如何在没有 UIViewController 的情况下旋转可见的 iOS 键盘

发布于 2025-01-06 08:24:08 字数 281 浏览 5 评论 0原文

我有一个 UIWindow,里面有一个硬编码的 UIView。我更愿意保持这种状态,有没有一种好的方法可以旋转已经可见的键盘? 这个问题问同样的事情,所以我猜我真的想问 UIViewController 用于旋转键盘的 API 是否是私有 API。如果是的话我不会使用它,但我仍然对它是什么感兴趣。以及你是如何发现的。谢谢!

I have a UIWindow with a hard-coded UIView inside. I'd prefer to keep it that way, is there a nice way to rotate an already visible keyboard? This question asks the same thing, so I guess I'm really asking if the API used by UIViewController to rotate the keyboard is private API. I'm not going to use it if it is, but I'd still be interested in what it is. And how you found out. Thanks!

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

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

发布评论

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

评论(1

把人绕傻吧 2025-01-13 08:24:08

UIViewController 为你处理旋转,你真的应该使用一个。不要尝试重新发明轮子,坚持最佳实践,您将避免很多不必要的工作。

https://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/AppArchitecture/AppArchitecture.html#//apple_ref/doc/uid/TP40007072-CH3-SW18

UIViewController类是所有视图控制器的基类
对象。它提供了加载视图的默认功能,
呈现它们,根据设备旋转来旋转它们,以及
其他几个标准系统行为

UIViewController handles the rotation for your, you really should use one. Don't try to reinvent the wheel, stick to the best practices and you will avoid a lot of unnecessary work.

https://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/AppArchitecture/AppArchitecture.html#//apple_ref/doc/uid/TP40007072-CH3-SW18

The UIViewController class is the base class for all view controller
objects. It provides default functionality for loading views,
presenting them, rotating them in response to device rotations, and
several other standard system behaviors

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