Android如何根据背景图片更改文本颜色 [英] Android How to change text color according to background image

查看:157
本文介绍了Android如何根据背景图片更改文本颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android上,我有一个带有背景图片的标题(根据API的随机图片).在此标题上,我有一些数据文本.我的文字每次都是黑色的,但有时图像也是黑色的.因此,我们看不到文字.

On Android, I have a header with a background image (Random image according to API). On this header I have texts with some data. My text is every time black but sometimes image is black too. So, we can't see the text.

我正在寻找图书馆或摘要来解决此问题.谢谢.

I'm looking for library or snippet for resolve this problem. Thanks.

推荐答案

您可以为此使用palatte库.请参阅以下内容:

You can use the palatte library for this. Please see the following:

https://developer.android.com/reference/android/support/v7/graphics/Palette.html

https://developer.android.com/training/material/palette-colors.html

这篇关于Android如何根据背景图片更改文本颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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