[問題] 繼承ImageView後 覆寫 onDraw 的問題
各位大大好
我寫了一個class BorderImage 繼承了 ImageView
主要是想幫我的image加邊框,程式碼如下
@Override
protected void onDraw( Canvas canvas){
setPadding( 4,4,4,4);
//設定邊界
Rect rect = canvas.getClipBounds();
rect.bottom += 4;
rect.top -= 4;
rect.left -= 4;
rect.right += 4;
//畫白色邊框
Paint paint = new Paint();
paint.setColor( Color.WHITE);
paint.setStyle( Paint.Style.FILL);
canvas.drawRect( rect, paint);
super.onDraw(canvas);
}
然後就會造成...
他最先剛開始會出現有點偏掉的圖 (如: http://ppt.cc/ItsP
過了約1秒才會變得跟正常(跟我預想的一樣) (如:http://ppt.cc/e_Th
請問這是怎樣的問題呢? QQ
謝謝各位大大的指教!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 211.21.125.247
※ 編輯: issuemylove 來自: 211.21.125.247 (03/08 16:18)
→
03/08 16:58, , 1F
03/08 16:58, 1F
→
03/08 17:00, , 2F
03/08 17:00, 2F
→
03/11 10:42, , 3F
03/11 10:42, 3F
→
03/11 11:30, , 4F
03/11 11:30, 4F
→
03/11 11:30, , 5F
03/11 11:30, 5F
AndroidDev 近期熱門文章
PTT數位生活區 即時熱門文章