我是黑莓新手,我正在开发一个黑莓应用程序,我在其中制作了一个登录屏幕,其中一个白色条形图像放置在顶部,并且徽标应该出现在该条上。所以很简单,我为它取了两个 HorizontalFieldManager,对于 strip,它会显示得很好,但 logo 留在 strip 的下方。
这是我的代码::
((VerticalFieldManager) getMainManager()).setBackground(BackgroundFactory.createSolidBackground(0xEDEDED));
HorizontalFieldManager hfm = new HorizontalFieldManager(Field.FIELD_VCENTER );
HorizontalFieldManager hfm2 = new HorizontalFieldManager(Field.FIELD_VCENTER );
Bitmap Topstrip = new Bitmap(Display.getWidth(), Display.getHeight());
Bitmap MoneLogo = new Bitmap(Display.getWidth(), Display.getHeight());
boolean lowRes = Display.getWidth() <= 320;
if (lowRes)
{
// The device has a low resolution screen size
Topstrip = Bitmap.getBitmapResource("topstripbg.png");
}
else
{
Topstrip = Bitmap.getBitmapResource("topstripbg-mdpi.png");
MoneLogo= Bitmap.getBitmapResource("logo72X72.png");
// The device has a high resolution screen size
}
BitmapField TopstripimgField = new BitmapField(Topstrip);
BitmapField MoneLogoimgField = new BitmapField(MoneLogo);
hfm.add(TopstripimgField);
hfm2.add(MoneLogoimgField);
add(hfm);
add(hfm2);
我想要这样::
--------------------------------------
____
|LOGO| ** Strip **
|____|
--------------------------------------
还请向我推荐好的 UI 教程以获得最佳实践
更新: