选择时将 TabBarController 上的每个选项卡设置为不同的颜色? [英] Setting each tab on TabBarController a different colour when selected?

查看:31
本文介绍了选择时将 TabBarController 上的每个选项卡设置为不同的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个标签栏,想根据选定的标签设置独立的色调,我知道我可以给它们着色,这样它们都会变成 1 种新颜色,但是我无法让它们各自独立选择时的颜色.有没有办法做到这一点?

I have a tab bar and want to set tints that are indipendent based on selected tab, I know I can tint them so they all change to 1 new color, however I havent been able to get them to each take on their own colour when selected. Is there a way to do this?

目前有这个,色调只是白色,我想独立地给每一个着色

currently have this, where the tint is just white, i want to tint each one indipendently

推荐答案

选择你的 Tabbar 项目并在属性检查器中设置 Selected ImageImage 为下面的栏项目检查图片供参考.

Select your Tabbar item and in attribute inspector set both Selected Image and Image for bar item check below Image for reference.

这篇关于选择时将 TabBarController 上的每个选项卡设置为不同的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆