新闻中心

EEPW首页 > 嵌入式系统 > 设计应用 > android去除ImageButton白色边框

android去除ImageButton白色边框

作者: 时间:2016-10-08 来源:网络 收藏

android ImageButton默认在图片周围添加了白色的边框,很不好看,去掉它的方法:

本文引用地址:https://www.eepw.com.cn/article/201610/305512.htm

设置如下属性:

android:background=#00ffffff

效果前后对比:

1//android:adjustViewBounds=true
2
3//android:padding=0dip

即可

其他:

1code>bitmap=((BitmapDrawable)(imgbt.getDrawable())).getBitmap();//得到ImageButton的图片
2
3
4if(bitmap.getPixel((int)(event.getX()),((int)event.getY()))==0){//判断点击处像素的颜色是否为0,0表示没 //内容/code>


关键词:

评论


相关推荐

技术专区

关闭