【发布时间】:2014-05-13 17:35:44
【问题描述】:
我正在尝试在垂直字段管理器中将标签垂直和水平居中。我已经成功地将它水平居中但不是垂直居中。问题是我没有尝试过任何样式常量(Field.FIELD_VCENTER、DrawStyle.VCENTER 等)。我得到了 BlackBerry JRE 6 的调试器,并为 Bold 9900 设备进行了开发。有人可以帮忙吗?
VerticalFieldManager vfm_listeAeroport=new VerticalFieldManager (USE_ALL_WIDTH){
protected void sublayout(int maxWidth, int maxHeight) {
super.sublayout(2*Display.getWidth()/3,70);
setExtent(2*Display.getWidth()/3,70);
}
protected void paint(Graphics g){
super.paint(g);
setBackground(BackgroundFactory.createSolidBackground(0xefc94c));
}
};
String mText = "Liste des Aéroports";
LabelField Label = new LabelField(mText,Field.FIELD_HCENTER) {
public void paint(Graphics graphics){
graphics.setColor(0xffffff);
super.paint(graphics);
}
};
vfm_listeAeroport.add(Label);
add(vfm_listeAeroport);
谢谢!
【问题讨论】:
标签: blackberry