简体   繁体   English

Android-字体(仅字母)背景色

[英]Android - font (only letters) background color

I want to make in my application some meme - type images. 我想在我的应用程序中添加一些模因-类型图像。

I've found some fonts, which I can use, but one thing, which is connecting them is, that when I'm changing textColor property for TextView, which is contining text, I'm changing contour of letters, not whole letter color. 我找到了一些可以使用的字体,但将它们连接起来的一件事是,当我更改TextView的textColor属性(即连续文本)时,我更改的是字母的轮廓,而不是整个字母的颜色。 When I'm changing background color, I'm changing whole TextView field background (and I want it to be transparent). 当我更改背景颜色时,我更改了整个TextView字段背景(并且我希望它是透明的)。 And the problem is, that in letter I can see background image of photo, which is under the letter, which is problem, because photos can have different colors and text could be not visible. 问题是,在信件中我可以看到照片的背景图像,该图像位于该字母下方,这是有问题的,因为照片可以具有不同的颜色并且文本可能不可见。 Is there any possibility, to change background color, but only for letters? 是否可以更改背景颜色,但仅适用于字母? Or it is a job for someone who is working with graphics and fonts? 还是对使用图形和字体的人来说是一项工作?

There is a photo, which is from my app, which is showing problem. 有一张照片,来自我的应用,显示有问题。 在此处输入图片说明


And there, what I'm looking for: 在这里,我正在寻找: 在此处输入图片说明
(source: canada.com ) (来源: canada.com

It sounds like you want to change the text colour not the background colour. 听起来您想更改文本颜色而不是背景颜色。

The thing is fonts are all defined like small bitmaps, if you change the colour only the opaque bits will be colourised never the bit's which were left transparent. 关键是字体的定义都像小位图一样,如果更改颜色,则仅不透明的位将被着色,而永远不会透明的位将被着色。

I think your only option is to change font 我认为您唯一的选择是更改字体

It sounds like what you want is text outline or a text shadow. 听起来您想要的是文本轮廓或文本阴影。 This question has both of those already answered. 这个问题已经回答了两个。 Or you could instead use solid font types. 或者,您可以改用纯字体类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM