如何着色我的文字黑色的轮廓在XML为Android [英] how to colour the outline of my text black in xml for android

查看:234
本文介绍了如何着色我的文字黑色的轮廓在XML为Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Andr​​oid应用程序的白色的文字有一个黑色的轮廓。我不想颜色的TextView的,所以如果这是你的帮助,然后不,我已经知道如何做到这一点。我想做到这一点通过XML格式使用的可绘制文件。那么有没有走,我可以概括我的文字的边缘XML?

i want to make the white coloured text in my android app have a black outline. I do not want to colour the textview so if that is your help then no i already know how to do this. I want to make this happen by using a drawable file in xml format. so is there away i can outline the edges of my text in xml?

推荐答案

一种方法是使用阴影

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textColor="#FFFFFF"
    android:shadowColor="#000000"
    android:shadowDx="0.0"
    android:shadowDy="0.0"
    android:shadowRadius="2.0" />

这给白色文本黑色轮廓。调整半径相应地你有多厚喜欢它。

This gives white text a black outline. Adjust the radius accordingly to how thick you'd like it.

这篇关于如何着色我的文字黑色的轮廓在XML为Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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