未选择 CustomButtonField
我无法选择自定义按钮字段
这是我的代码:-
public MenuScreen()
{
super(Screen.DEFAULT_CLOSE);
verticalOffset=Display.getWidth();
menuBackgroundImage=Bitmap.getBitmapResource("com/greetings/Images/MenuBackground.jpg");
categories=new CustomSmallButton(Bitmap.getBitmapResource("com/greetings/ButtonImage/categoryon.png"),Bitmap.getBitmapResource("com/greetings/ButtonImage/categoryoff.png"),0);
categories.setChangeListener(this);
help=new CustomSmallButton(Bitmap.getBitmapResource("com/greetings/ButtonImage/helpon.png"),Bitmap.getBitmapResource("com/greetings/ButtonImage/helpoff.png"),0);
help.setChangeListener(this);
developer=new CustomSmallButton(Bitmap.getBitmapResource("com/greetings/ButtonImage/aboutuson.png"),Bitmap.getBitmapResource("com/greetings/ButtonImage/aboutuspoff.png"),0);
developer.setChangeListener(this);
VerticalFieldManager manager = new VerticalFieldManager()
{
protected void sublayout(int width, int height)
{
width=fwidth;
height=fHeight;
super.sublayout(width,height);
setPositionChild(categories, width-240, height-350);
setPositionChild(help, width-240, height-290);
setPositionChild(developer, width-240, height-230);
setExtent(width, height);
}
};
manager.setBackground(BackgroundFactory.createBitmapBackground(menuBackgroundImage));
manager.add(categories);
manager.add(help);
manager.add(developer);
add(manager);
}
public void fieldChanged(Field field, int context) {
if(field==categories)
{
templateCategories=new TemplateCategories(2);
UiApplication.getUiApplication().pushScreen(templateCategories);
}
if(field== help)
{
helpScreen=new HelpScreen();
UiApplication.getUiApplication().pushScreen(helpScreen);
}
if(field == developer)
{
developerScreen=new DeveloperScreen();
UiApplication.getUiApplication().pushScreen(developerScreen);
}
}
当我单击“帮助”或“开发人员”按钮时,它不会选择。
I am not able select the custombuttonfield
Here is my code:-
public MenuScreen()
{
super(Screen.DEFAULT_CLOSE);
verticalOffset=Display.getWidth();
menuBackgroundImage=Bitmap.getBitmapResource("com/greetings/Images/MenuBackground.jpg");
categories=new CustomSmallButton(Bitmap.getBitmapResource("com/greetings/ButtonImage/categoryon.png"),Bitmap.getBitmapResource("com/greetings/ButtonImage/categoryoff.png"),0);
categories.setChangeListener(this);
help=new CustomSmallButton(Bitmap.getBitmapResource("com/greetings/ButtonImage/helpon.png"),Bitmap.getBitmapResource("com/greetings/ButtonImage/helpoff.png"),0);
help.setChangeListener(this);
developer=new CustomSmallButton(Bitmap.getBitmapResource("com/greetings/ButtonImage/aboutuson.png"),Bitmap.getBitmapResource("com/greetings/ButtonImage/aboutuspoff.png"),0);
developer.setChangeListener(this);
VerticalFieldManager manager = new VerticalFieldManager()
{
protected void sublayout(int width, int height)
{
width=fwidth;
height=fHeight;
super.sublayout(width,height);
setPositionChild(categories, width-240, height-350);
setPositionChild(help, width-240, height-290);
setPositionChild(developer, width-240, height-230);
setExtent(width, height);
}
};
manager.setBackground(BackgroundFactory.createBitmapBackground(menuBackgroundImage));
manager.add(categories);
manager.add(help);
manager.add(developer);
add(manager);
}
public void fieldChanged(Field field, int context) {
if(field==categories)
{
templateCategories=new TemplateCategories(2);
UiApplication.getUiApplication().pushScreen(templateCategories);
}
if(field== help)
{
helpScreen=new HelpScreen();
UiApplication.getUiApplication().pushScreen(helpScreen);
}
if(field == developer)
{
developerScreen=new DeveloperScreen();
UiApplication.getUiApplication().pushScreen(developerScreen);
}
}
when i am clicking help or developer button its not selecting.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
覆盖
您的 CustomSmallButton 类中的
override the
in your CustomSmallButton class