如何在Android中创建一个圆形的imageButton? [英] how to create a circular imageButton in android?

查看:97
本文介绍了如何在Android中创建一个圆形的imageButton?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们,我在布局文件中创建了一个imageButton,并设置了一个圆形png图像作为背景.但是,当我运行我的应用程序时,它向我显示一个方形按钮,并将给定的图像置于其中.

Guys i have created a imageButton in my layout file and set a circular png image as its background.but when i am running my application, its displaying me a square button with my given image placed in the middle of it.

<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 ="@ null"

这篇关于如何在Android中创建一个圆形的imageButton?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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