我想在BitmapField
的焦點上的特定標籤中設置一個文本,並重置未聚焦的文本。我正在使用以下代碼:黑莓BitmapField focus-unfocus prob
final BitmapField tab1 = new BitmapField(Bitmap.getBitmapResource("img/icon1.png"), FIELD_BOTTOM | BitmapField.FOCUSABLE) {
protected void drawFocus(Graphics graphics, boolean on) {
// the simplies way to draw a rectangle and this will be the
// focus
}
protected boolean navigationClick(int status, int time) {
// write here your code what you want to run the user clicks to
// the bitmap
// try something like this
Dialog.alert("Code for tab1");
return true;
}
public void setFocus(){
super.setFocus();
selectedLabel.setText("tab1");
}
public void onUnfocus(){
super.onUnfocus();
selectedLabel.setText("");
}
};
但是重點正在改變,但標籤根本沒有設置。我的代碼中的問題在哪裏?