我想在黑莓屏幕的底部显示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