iOS 自定义 tabview 栏,具有不同大小的图标
有没有办法自定义底部选项卡视图按钮以具有不同的尺寸甚至形状。像这样的东西:
谢谢!
Is there a way to customize the bottom tabview buttons to have different sizes and even shape. Something like this:
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,如果您希望
UITabBar
具有不同的形状或大小,即使通过子类化UITabBar
也无法更改它。首先,您需要查看另一种类型的
UIView
的子类 - 普通UIView
或UIImageView
,将图标添加到并配置触摸事件以使它们执行您想要的操作。以下是一些帮助您入门的有用资源:
If you want the
UITabBar
to have a different shape or size, unfortunately, you won't be able to change it even by subclassingUITabBar
.To get started, you'll want to take a look at subclassing another type of
UIView
-- either vanillaUIView
orUIImageView
, 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: