2
有人知道我可以在我的CLDC應用程序中使用的Image Image-like Blackberry Control嗎?如果沒有,是否有辦法在MainScreen或BitmapField派生控件上獲取單擊x,y座標?Image-like Blackberry Control - CLDC應用程序
感謝,
有人知道我可以在我的CLDC應用程序中使用的Image Image-like Blackberry Control嗎?如果沒有,是否有辦法在MainScreen或BitmapField派生控件上獲取單擊x,y座標?Image-like Blackberry Control - CLDC應用程序
感謝,
我假設你在想這個控制風暴 - 爲其上點擊屏幕上的任意一點有意義的唯一設備。
在這種情況下,最簡單的方法可能是繼承BitmapField要成爲焦點,並響應點擊 - 是這樣的:
public class ClickableBitmapField extends BitmapField {
// Make the control focusable
public boolean isFocusable() {
return true;
}
protected boolean touchEvent(TouchEvent message) {
if (message.getEventCode == TouchEvent.CLICK) {
int x = message.getX();
int y = message.getY();
// do something with x and y here
}
}
}
當然它會是一個複雜得多實現影像地圖類型軌跡球設備的功能 - 你必須保持一個光標或一些東西,以便用戶知道他們點擊的位置。
我想要所有最近的黑莓的東西。我最終從FullScreen中派生出來並自己處理所有事情。它似乎工作得很好。 – ConsultUtah 2009-04-27 15:03:38