tabBar里面的icon的颜色如何设置或者改变?

小程序 文章 2020-08-24 09:21 1272 0 全屏看文

AI助手支持GPT4.0

tabBar里面的icon的颜色如何设置或者改变?How to set or change the color of the icon in the tabBar?

tabBar里面的icon的颜色如何设置或者改变?

tabBar里面的icon的颜色如何设置或者改变?

app.json关于tabBar的配置如下图

"iconPath": "/images/images/home_page.png",

"selectedIconPath":"/images/images/home_page_selected.png"

因为在"iconPath" 和"selectedIconPath"路径下面

分别放置了两张自己找的图片

“home_page.png”

和“home_page_selected.png"

有什么办法可以设置或者改变icon的颜色?特别是"selectedIconPath"路径下面icon的颜色?比如绿色或者红色?

或者不用放置自己找的图片,有其他方法设置icon样式和icon的颜色?

How to set or change the color of the icon in the tabbar? app.json The configuration of the tabbar is shown in the figure "iconpath": / images / images / home_ page.png ", "selectedIconPath":"/images/images/home_ page_ selected.png "Because there are two pictures" home "under the path of" iconpath "and" selectediniconpath "_ page.png ”And "home"_ page_ selected.png "Is there any way to set or change the color of an icon? In particular, the color of the icon under the "selected icon path" path? Like green or red? Or is there any other way to set the icon style and color without placing the image you're looking for?

回答:

xy:

你可以使用自定义tabbar

仙ღ₅₂₀¹³¹⁴:

= = 你找个有颜色的icon。。或者 动态设置icon地址。

https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.setTabBarItem.html

?:

现在找icon一般在iconfont上找,可以自定义颜色、大小。你从上面找一套差不多的自定义一下下载下来不就好了么...

夕阳西下?:

你可以用ps修改图片颜色。

或者用阿里云图标库的图标,那样就可以在代码修改颜色了

Alex:

有同学可以帮忙邀请技术大佬或者小程序社区技术运营专员来回答吗?

-EOF-

AI助手支持GPT4.0