如何在ViewBased应用程序中添加UITabBar?

发布于 2024-10-23 21:31:37 字数 76 浏览 7 评论 0原文

我想在 ViewController 的 viewDidLoad 中制作 UITabBar(不是 UITabBarController)。

I want to make UITabBar, (not UITabBarController) in my viewDidLoad of ViewController.

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

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

发布评论

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

评论(1

百善笑为先 2024-10-30 21:31:37

你想在你的 viewDidLoad 中“制作”UITabBar 吗?我假设您想在没有选项卡栏控制器的情况下使用 UITabBar...

只需创建 UITabBar 的对象,将控制器设置为委托,将其作为子视图添加到控制器的视图中,实现选项卡栏委托方法..你就完成了..
当然,您必须指定它应该有多少个选项卡、它们的标题、图像等,就像使用选项卡栏控制器一样......

You want to 'make' UITabBar in your viewDidLoad?? I am going to assume that you want to use a UITabBar without the tab bar controller...

just create an object of UITabBar, set your controller as it's delegate, add it as a subview to your controller's view, implement the tab bar delegate methods.. and you are doen..
of course you'll have to specify how many tabs it should have, their titles, images etc just like you do with a tab bar controller...

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