iOS 自定义 tabview 栏,具有不同大小的图标

发布于 2024-12-23 10:11:30 字数 125 浏览 3 评论 0原文

有没有办法自定义底部选项卡视图按钮以具有不同的尺寸甚至形状。像这样的东西:

在此处输入图像描述

谢谢!

Is there a way to customize the bottom tabview buttons to have different sizes and even shape. Something like this:

enter image description here

Thanks!

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

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

发布评论

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

评论(1

坏尐絯℡ 2024-12-30 10:11:30

不幸的是,如果您希望 UITabBar 具有不同的形状或大小,即使通过子类化 UITabBar 也无法更改它。

首先,您需要查看另一种类型的 UIView 的子类 - 普通 UIViewUIImageView,将图标添加到并配置触摸事件以使它们执行您想要的操作。

以下是一些帮助您入门的有用资源:

If you want the UITabBar to have a different shape or size, unfortunately, you won't be able to change it even by subclassing UITabBar.

To get started, you'll want to take a look at subclassing another type of UIView -- either vanilla UIView or UIImageView, add icons to them, and configure touch events to make them do what you want.

Here's some helpful resources for you to get started:

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