android去除ImageButton白色邊框
掃描二維碼
隨時(shí)隨地手機(jī)看文章
android ImageButton默認(rèn)在圖片周圍添加了白色的邊框,很不好看,去掉它的方法:
設(shè)置如下屬性:
android:background="#00ffffff"
效果前后對(duì)比:
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){//判斷點(diǎn)擊處像素的顏色是否為0,0表示沒(méi) //內(nèi)容</code> |





