是否有可能改变iOS的小吃店的BackgroundColor?(Is it possible to change BackgroundColor of snackbar for ios?)

编程入门 行业动态 更新时间:2024-10-11 23:15:59
是否有可能改变iOS的小吃店的BackgroundColor?(Is it possible to change BackgroundColor of snackbar for ios?)

我的应用程序使用材料组件ios快餐栏。 我想将BackgroundColor更改为蓝色,但我不能。

那么是否可以改变小吃店的背景颜色?

My app uses a snackbar of material-components-ios. I want to change BackgroundColor to blue, but I can't.

So is it possible to change the background color of snackbar?

最满意答案

你必须破解它。 :)

在你的豆荚里有一个叫做的文件。

MDCSnackbarMessageView.m

有这样的功能。 我已将该值更改为蓝色。 它将采用十六进制值的颜色代码。

- (UIColor *)snackbarBackgroundColor { // return MDCRGBAColor(0x32, 0x32, 0x32, 1.0f); //previous grey color return MDCRGBAColor(0x10, 0x3F, 0xFF, 1.0f);// blue color }

现在呢, 清理并重新构建 。 这是输出。

在这里输入图像描述

You have to hack it. :)

In your pods there is a file called.

MDCSnackbarMessageView.m

there is function like this. I changed the value already to blue. And it will take hex value color code.

- (UIColor *)snackbarBackgroundColor { // return MDCRGBAColor(0x32, 0x32, 0x32, 1.0f); //previous grey color return MDCRGBAColor(0x10, 0x3F, 0xFF, 1.0f);// blue color }

Now do, clean and build again. Here is the output.

enter image description here

更多推荐

本文发布于:2023-08-01 01:02:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1350660.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:小吃店   有可能   iOS   BackgroundColor   snackbar

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!