我想制作一个圆形按钮,但我不知道该怎么做。我可以制作带有圆角的按钮,但是我怎样才能制作圆形。这是不一样的。请问一下,安卓上可以吗?谢谢。
创建一个名为的 xml 文件roundedbutton.xml
在可绘制文件夹中
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#eeffffff" />
<corners android:bottomRightRadius="8dp"
android:bottomLeftRadius="8dp"
android:topRightRadius="8dp"
android:topLeftRadius="8dp"/>
</shape>
最后将其设置为背景Button
as android:background = "@drawable/roundedbutton"
如果你想让它完全圆形,改变半径并选择适合你的东西。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)