使用 UITabbaritem 作为 UIButton
有没有办法将 UITabbaritem 用作 UIButton? 我正在尝试制作一个标签栏,其项目不会改变视图。只是希望他们在同一个视图控制器中执行简单的操作。
谢谢。
Is there a way to use UITabbaritem as a UIButton?
I am trying to make a Tabbar that its items don't change the view. Just want them to do simple actions in the same view controller.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
通过创建 UITabBarDelegate 并实现正确的方法,这可能是可能的,但这样做会违反 Apple 的 HIG 并导致您的应用被拒绝。
UIToolbar
是用于您所描述内容的正确类。来自该文档:It's probably possible, by creating a
UITabBarDelegate
and implementing the correct methods, but doing so would violate Apple's HIG and cause your app to be rejected.UIToolbar
is the correct class to use for what you're describing. From that doc:不,它继承自 UIBarItems:NSObject。 UIButton继承自UIControl。
No. It inherits from UIBarItems:NSObject. UIButton inherits from UIControl.
试试这个
try this