我想在黑莓屏幕的底部顯示4個可點擊的圖像/圖標,我無法找到任何示例應用程序。請分享一些片段。在屏幕底部添加圖像/圖標
我都試過,但我不能夠在底部顯示此圖像,使之可點擊
package com.samples.backgroundImage;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;
public class NativeUI extends UiApplication
{
private Bitmap backgroundBitmap;
private Bitmap fieldBitmap;
public static void main(String[] args)
{
NativeUI theApp = new NativeUI();
theApp.enterEventDispatcher();
}
public NativeUI()
{
//The background image.
backgroundBitmap = Bitmap.getBitmapResource("cryptodemo_jde.png");
MainScreen mainScreen = new MainScreen();
HorizontalFieldManager horizontalFieldManager = new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH | HorizontalFieldManager.USE_ALL_HEIGHT){
//Override the paint method to draw the background image.
public void paint(Graphics graphics)
{
//Draw the background image and then call paint.
graphics.drawBitmap(0, 0, 240, 240, backgroundBitmap, 0, 0);
super.paint(graphics);
}
};
//The LabelField will show up through the transparent image.
LabelField labelField = new LabelField("This is a label");
//A bitmap field with a transparent image.
//The background image will show up through the transparent BitMapField image.
BitmapField bitmapField = new BitmapField(Bitmap.getBitmapResource("pimdemo_jde.png"));
//Add the manager to the screen.
mainScreen.add(horizontalFieldManager);
BasicEditField bef = new BasicEditField("To: ","",50,BasicEditField.FILTER_EMAIL);
horizontalFieldManager.add(bef);
//Add the fields to the manager.
horizontalFieldManager.add(labelField);
horizontalFieldManager.add(bitmapField);
//Push the screen.
pushScreen(mainScreen);
}
}
檢查這個問題,你的代碼,[黑莓 - 如何佔領與圖像的完成按鈕(http://stackoverflow.com/q/4509519/396949 ),在SO上。 – mrvincenzo 2012-03-18 12:59:27
我想在屏幕下方顯示圖像而不是按鈕 – 2012-03-18 13:01:13
@MrVincenzo任何示例 – 2012-03-18 13:13:27