是否有可能改变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.
更多推荐
发布评论