android去除ImageButton白色边框
android ImageButton默认在图片周围添加了白色的边框,很不好看,去掉它的方法:
本文引用地址:https://www.eepw.com.cn/article/201610/305512.htm设置如下属性:
android:background=#00ffffff
效果前后对比:


1 | //android:adjustViewBounds=true |
2 |
|
3 | //android:padding=0dip |
即可
其他:
1 | code>bitmap=((BitmapDrawable)(imgbt.getDrawable())).getBitmap(); //得到ImageButton的图片 |
2 |
3 |
4 | if (bitmap.getPixel(( int )(event.getX()),(( int )event.getY()))== 0 ){ //判断点击处像素的颜色是否为0,0表示没 //内容/code> |
评论