【发布时间】:2014-07-15 07:46:46
【问题描述】:
所以我在布局中创建了一个按钮,但我希望它是一个圆圈。 所以我创建了一个像这样的 .xml 可绘制对象 -
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#673ab7"/>
<stroke android:width="2sp" android:color="#fff" />
</shape>
然后在布局中的按钮位中添加了这个
android:background="@drawable/circle_button"
但现在我希望在圆圈按钮内有一个图像。我怎样才能做到这一点?我可以简单地在可绘制的 xml 中添加一些东西吗?
我尝试过寻找答案,但对我应该寻找什么感到困惑。
【问题讨论】:
-
查看我的回答并给我反馈。