点击位图check_box1
check_box2
的位图check_box1
btmp_on = EncodedImage
.getEncodedImageResource("btn_check_on.png");
btmp_off = EncodedImage
.getEncodedImageResource("btn_check_off.png");
Bitmap check_box1 = getScaledBitmapImage(btmp_off,30,40);
Bitmap check_box2 = getScaledBitmapImage(btmp_on,30,40);
答案 0 :(得分:0)
请参阅以下链接:
并且对于触摸设备,将 fieldChanged 中的相同代码添加到 touchEvent 像:
protected boolean touchEvent(TouchEvent message)
{
switch( message.getEvent() )
{
case TouchEvent.CLICK:
clickButton();
break;
default: break;
}
return super.touchEvent(message);
}
private void clickButton()
{
Field focussedOne=this.getLeafFieldWithFocus();//Means this is the last field which is not having any otherFields;
for(int i=0;i<size;i++)
{
if(focussedOne==listStyleButtonField[i])
{
if(listStyleButtonField[i].getChanged())
listStyleButtonField[i].changeBitmap(bitmap,false);
else
listStyleButtonField[i].changeBitmap(bitmapHover,true);
}
}
}