Android textview 大纲文本 [英] Android textview outline text
问题描述
有没有一种简单的方法可以让文本具有黑色轮廓?我有不同颜色的文本视图,但有些颜色不能很好地显示在我的背景上,所以我想知道是否有一种简单的方法可以获得黑色轮廓或其他可以完成这项工作的方法?我不想创建自定义视图并制作画布等.
Is there a simple way to have text be able to have a black outline? I have textviews that will be different colors, but some of the colors don't show up on my background so well, so I was wondering if there's an easy way to get a black outline or something else that will do the job? I'd prefer not to have to create a custom view and make a canvas and such.
推荐答案
您可以在文本后面放置阴影,这通常有助于提高可读性.尝试在绿色文本上使用 50% 的半透明黑色阴影.有关如何执行此操作的详细信息,请参见此处:Android - 文本上的阴影?
You can put a shadow behind the text, which can often help readability. Try experimenting with 50% translucent black shadows on your green text. Details on how to do this are over here: Android - shadow on text?
要真正在文本周围添加笔触,您需要做一些更复杂的事情,如下所示:你如何用Android 中 MapView 上的边框?
To really add a stroke around the text, you need to do something a bit more involved, like this: How do you draw text with a border on a MapView in Android?
这篇关于Android textview 大纲文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!