1
我想將徽標和文本字段居中放置在屏幕中間,既垂直又水平放置。達到此目的的最佳方法是什麼?如何使用水平字段在屏幕上居中放置標籤
我迄今已試圖與這個..
public upd8rMainScreen(){
Bitmap logoBitmap = Bitmap.getBitmapResource("upd8rLOGO.png");
bitmapField = new BitmapField(logoBitmap, Field.FIELD_VCENTER);
labelfield = new LabelField("Tap Your Phone Onto The Reader To Activate",Field.FIELD_VCENTER);
topHfm = new HorizontalFieldManager(Manager.VERTICAL_SCROLL);
middleHfm = new HorizontalFieldManager(Manager.VERTICAL_SCROLL);
vfm = new VerticalFieldManager();
topHfm.add(bitmapField);
middleHfm.add(labelfield);
vfm.add(topHfm);
vfm.add(middleHfm);
add(vfm);
}
嘗試添加樣式位**'Manager.FIELD_HCENTER' **與**一起' Manager.VERTICAL_SCROLL' **樣式位,即使用**'新的HorizontalFieldManager(Manager.VERTICAL_SCROLL | Manager.FIELD_HCENTER)'**。看到我今天早上發佈的答案[這裏](http://stackoverflow.com/questions/8707608/horizontally-centering-fields-in-a-vertical-field-manager),這可能會幫助你。 – 2012-01-03 11:32:32