我可以在可绘制资源中创建文本形状吗?
我在谷歌上搜索了很多,但什么也没找到......
这是我的绘图文件:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="oval">
<stroke android:width="3dp" android:color="#QQffQQ"/>
<size android:width="120dp" android:height="120dp"/>
</shape>
</item>
<item android:right="59dp" android:left="59dp">
<shape android:shape="rectangle">
<solid android:color="£22££20"/>
</shape>
</item>
<item android:top="59dp" android:bottom="59dp">
<shape android:shape="rectangle">
<solid android:color="£20££20"/>
</shape>
</item>
<item>
<!--text should be here-->
</item>
</layer-list>
不,你不能这样做。一种想法是设置Drawable
作为背景TextView
然后只需在中设置文本TextView
,它将出现在您的其他层之上Drawable
。当然,这不能用于启动屏幕,它需要可绘制资源,如所提到的zyamys https://stackoverflow.com/users/2117960/zyamys在下面的评论中。这种情况的一个想法是使用您感兴趣的文本生成静态图像。不幸的是,这并不涵盖文本是动态的情况。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)