定制UITabbar的想法?

发布于 2024-12-01 11:40:31 字数 153 浏览 3 评论 0原文

我读了很多关于自定义所选选项卡栏项目颜色的文章,默认情况下实际上是蓝色的。

我的想法是在每个按钮上放置一个 UIImageView。 一旦用户选择一个按钮,我就会显示图像(这是相同的图标,但具有另一种颜色作为渐变)。

你对此有何看法?

提前致谢

I read many posts on customizing color of selected tabbar item which is actually blue by default.

My idea was to put an UIImageView on each of my button.
Once the user select one button, I would then display the image (which is the same icon but with another colour as a gradient).

What do you think about that ?

Thanks in advance

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

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

发布评论

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

评论(2

梦行七里 2024-12-08 11:40:31

您始终可以使用此 http://idevrecipes.com/2011/01/04/how-does-the-twitter-iphone-app-implement-a-custom-tab-bar/ 并将其更改为包含文本并修改颜色。

You could always use this http://idevrecipes.com/2011/01/04/how-does-the-twitter-iphone-app-implement-a-custom-tab-bar/ and change it to include text and modify the colour.

会傲 2024-12-08 11:40:31

Thankfully, iOS 5 introduced an appearance proxy allowing customisation of most basic UI elements, including the trusty UITabBar. The proxy is used to change ALL instances of a class throughout an application. However, with this came some basic properties available for specific instances.

请参阅 UITabBar 的 selectedImageTintColor 属性来满足您的需求。

此类的其他外观添加包括tintColor、backgroundImage 和selectionIndicatorImage。

Thankfully, iOS 5 introduced an appearance proxy allowing customisation of most basic UI elements, including the trusty UITabBar. The proxy is used to change ALL instances of a class throughout an application. However, with this came some basic properties available for specific instances.

See the selectedImageTintColor property of UITabBar for your needs.

Other appearance additions for this class are tintColor, backgroundImage and selectionIndicatorImage.

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