我试图获得圆形图像按钮。但它正在显示带有方形背景的圆形图像,但我只需要没有任何背景的图像。 我也使用round_image.XML作为背景可绘制文件,但它不工作。如何获得Android工作室的圆形图像按钮
menu.xml文件
<ImageButton
android:id="@+id/imageButton1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:src="@drawable/sliderr" android:background="@drawable/round_image"/>
round_image.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="oval">
<gradient android:startColor="#50d050
android:endColor="#008000" android:angle="270"/>
<stroke
android:width="1px"
android:color="#000000"/>
</shape>
你尝试过这个http://stackoverflow.com/问题/ 9884202 /定制圆形按钮 –
是啊!但我没有使用状态按下和重点。我曾尝试使用选择器。 –
Possilble重复的:http://stackoverflow.com/questions/21397115/rounded-image-button-android –