如何在黑莓java的垂直屏幕中对齐图像?

时间:2015-02-08 17:26:06

标签: java blackberry

我正在开发一个应用程序,我需要对齐图像,如下所示。

 |------------------------------|
 |                              |
 |                              |
 |                              |
 |                              |
 |          |---------|         |
 |          |         |         |
 |          |---------|         |                    
 |                              |
 |                              |
 |                              |
 |                              |
 |                              |
 |                              |
 |                              |
 |                              |
 |                              |
 |______________________________|

我尝试下面的代码,但我在屏幕上方获取图像,当我执行下面的代码我做了什么错误请帮助我,我是黑莓新手

public final class MyScreen extends MainScreen
{
private BitmapField bitmapField;

/**
 * Creates a new MyScreen object
 */
public MyScreen()
{        
    // Set the displayed title of the screen       
    setTitle("MyTitle");
    VerticalFieldManager MainLayout = new 
    VerticalFieldManager(Manager.USE_ALL_HEIGHT|Manager.USE_ALL_WIDTH|
  Manager.VERTICAL_SCROLLBAR);
  HorizontalFieldManager hfm =  new      
  HorizontalFieldManager(Field.FIELD_HCENTER | Field.FIELD_VCENTER);
    Bitmap logo1 = Bitmap.getBitmapResource("Lock.png");
    bitmapField = new BitmapField(logo1);
    hfm.add (bitmapField);
    MainLayout.add(hfm);
    add(MainLayout);
}
}

0 个答案:

没有答案