黑莓手机:在HorizontalFieldManager 2按钮之间减少空间 [英] BlackBerry:Reduce space between 2 buttons in HorizontalFieldManager
问题描述
喜
在黑莓我创建了一个水平场managar并添加小尺寸的某些按钮将其在screen.But的底部我的问题是有2 buttons.I之间太多的空间来显示工具栏已经减少2之间的空间按钮,这样我可以设法把ATLEAST 6个按键在screen.I底部正在使用BFmsg.setMargin(305,0,0,40)
声明。任何人都可以请帮我在这。
hi In blackberry i have created a horizontal field managar and added some buttons of small size to it to display toolbar at the bottom of the screen.But my problem is there is too much space between the 2 buttons.I have to reduce this space between 2 buttons so that i can manage to place atleast 6 buttons at the bottom of the screen.I am using the BFmsg.setMargin(305,0,0,40) statement. can anyone please help me on this.
以下是我的code:
BFcontacts = new ButtonField("Cnt")
{
protected void paint(Graphics graphics)
{
//Bitmap contactsbitmap = Bitmap.getBitmapResource("contacts.jpg");
//graphics.drawBitmap(0, 0, contactsbitmap.getWidth(), contactsbitmap.getHeight(), contactsbitmap, 0, 0);
graphics.setColor(Color.WHITE);
graphics.drawText("Cnt",0,0);
}
};
BFcontacts.setMargin(305,0,0,10);//vertical pos,0,0,horizontal pos
HFM.add(BFcontacts);
BFmsg = new ButtonField("Msgs")
{
protected void paint(Graphics graphics)
{
//Bitmap msgsbitmap = Bitmap.getBitmapResource("messages.jpg");
//graphics.drawBitmap(0, 0, msgsbitmap.getWidth(), msgsbitmap.getHeight(), msgsbitmap, 0, 0);
graphics.setColor(Color.WHITE);
graphics.drawText("Msgs",0,0);
}
};
BFmsg.setMargin(305,0,0,40);//vertical pos,0,0,horizontal pos : original
HFM.add(BFmsg);
add(HFM)
在此先感谢
推荐答案
具有u使用自定义的经理试图ü可以将内容根据乌拉圭回合的选择这样的
have u tried using custom manager u can place the contents as per ur choice like this
创建该类的对象,并添加项目
Create object of this class and add items to it
class BottomManager extends Manager
{
BottomManager()
{
super(Manager.NO_VERTICAL_SCROLL);
}
protected void sublayout(int width, int height)
{
Field field = getField(0);
layoutChild(field,Display.getWidth(), Display.getHeight());
setPositionChild(field,0,0);
field = getField(1);
layoutChild(field,Display.getWidth(), Display.getHeight());
setPositionChild(field,10+getField(0).getWidth(),0);
field = getField(2);
layoutChild(field,Display.getWidth(), Display.getHeight());
setPositionChild(field,10+getField(1).getWidth(),0);
field = getField(3);
layoutChild(field,Display.getWidth(), Display.getHeight());
setPositionChild(field,getField(2).getWidth()+10,0);
setExtent(Display.getWidth(), 40);
}
}
这篇关于黑莓手机:在HorizontalFieldManager 2按钮之间减少空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!