我生成了如下代码,但重置按钮未在开始和完成按钮之间显示
我生成了如下代码,但重置按钮未在开始和完成按钮之间显示。有人帮我显示重置按钮吗?
提前致谢
final BitmapField mybitmapresetField = new BitmapField(Bitmap.getBitmapResource("res/images/start_button.png"),FOCUSABLE);
protected void sublayout(int maxWidth, int maxHeight) {
layoutChild( mybitmapstartField, maxWidth, maxHeight);
setPositionChild( mybitmapstartField, 140, 0);
layoutChild( mybitmapresetField, maxWidth, maxHeight);
setPositionChild( mybitmapresetField, 0, 0);
layoutChild(mybitmapfinishField, maxWidth, maxHeight);
setPositionChild(mybitmapfinishField, 280, 0);
layoutChild(mybitmaplogoField, maxWidth, maxHeight);
setPositionChild(mybitmaplogoField, 20, 440);
layoutChild( mybitmaphowtoField, maxWidth, maxHeight);
setPositionChild( mybitmaphowtoField, 140, 440);
layoutChild( mybitmapm1Field, maxWidth, maxHeight);
setPositionChild( mybitmapm1Field, 190, 60);
layoutChild( mybitmapleftyrField, maxWidth, maxHeight);
setPositionChild( mybitmapleftyrField, 120, 100);
layoutChild( mybitmaprightyrField, maxWidth, maxHeight);
setPositionChild( mybitmaprightyrField, 280, 100);
layoutChild( backgroundBitmapbar1, maxWidth, maxHeight);
setPositionChild( backgroundBitmapbar1, 10, 140);
layoutChild( backgroundBitmapbar2, maxWidth, maxHeight);
setPositionChild( backgroundBitmapbar2, 10, 180);
layoutChild( backgroundBitmapbar3, maxWidth, maxHeight);
setPositionChild( backgroundBitmapbar3, 10, 220);
layoutChild( backgroundBitmapbar4, maxWidth, maxHeight);
setPositionChild( backgroundBitmapbar4, 10, 260);
layoutChild( backgroundBitmapbar5, maxWidth, maxHeight);
setPositionChild( backgroundBitmapbar5, 10, 300);
layoutChild( backgroundBitmapbar6, maxWidth, maxHeight);
setPositionChild( backgroundBitmapbar6, 10, 340);
layoutChild( timerCount , maxWidth, maxHeight);
setPositionChild( timerCount , 274, 443);
setExtent(Display.getWidth(),Display.getHeight());
}
};
_vfm.add(mybitmapstartField) ;
_vfm.add(mybitmapresetField) ;
_vfm.add(mybitmapfinishField) ;
_vfm.add(mybitmaplogoField) ;
_vfm.add(mybitmapm1Field) ;
_vfm.add(mybitmapleftyrField) ;
_vfm.add(mybitmaprightyrField) ;
_vfm.add( mybitmaphowtoField) ;
_vfm.add(timerCount) ;
_vfm.add(backgroundBitmapbar1) ;
_vfm.add(backgroundBitmapbar2) ;
_vfm.add(backgroundBitmapbar3) ;
_vfm.add(backgroundBitmapbar4) ;
_vfm.add(backgroundBitmapbar5) ;
_vfm.add(backgroundBitmapbar6) ;
this.add(_vfm);
}
I generated the code as below, but reset button is not displaying between start and finish buttons. Any one help me to display the reset button?
Thanks in advance
final BitmapField mybitmapresetField = new BitmapField(Bitmap.getBitmapResource("res/images/start_button.png"),FOCUSABLE);
protected void sublayout(int maxWidth, int maxHeight) {
layoutChild( mybitmapstartField, maxWidth, maxHeight);
setPositionChild( mybitmapstartField, 140, 0);
layoutChild( mybitmapresetField, maxWidth, maxHeight);
setPositionChild( mybitmapresetField, 0, 0);
layoutChild(mybitmapfinishField, maxWidth, maxHeight);
setPositionChild(mybitmapfinishField, 280, 0);
layoutChild(mybitmaplogoField, maxWidth, maxHeight);
setPositionChild(mybitmaplogoField, 20, 440);
layoutChild( mybitmaphowtoField, maxWidth, maxHeight);
setPositionChild( mybitmaphowtoField, 140, 440);
layoutChild( mybitmapm1Field, maxWidth, maxHeight);
setPositionChild( mybitmapm1Field, 190, 60);
layoutChild( mybitmapleftyrField, maxWidth, maxHeight);
setPositionChild( mybitmapleftyrField, 120, 100);
layoutChild( mybitmaprightyrField, maxWidth, maxHeight);
setPositionChild( mybitmaprightyrField, 280, 100);
layoutChild( backgroundBitmapbar1, maxWidth, maxHeight);
setPositionChild( backgroundBitmapbar1, 10, 140);
layoutChild( backgroundBitmapbar2, maxWidth, maxHeight);
setPositionChild( backgroundBitmapbar2, 10, 180);
layoutChild( backgroundBitmapbar3, maxWidth, maxHeight);
setPositionChild( backgroundBitmapbar3, 10, 220);
layoutChild( backgroundBitmapbar4, maxWidth, maxHeight);
setPositionChild( backgroundBitmapbar4, 10, 260);
layoutChild( backgroundBitmapbar5, maxWidth, maxHeight);
setPositionChild( backgroundBitmapbar5, 10, 300);
layoutChild( backgroundBitmapbar6, maxWidth, maxHeight);
setPositionChild( backgroundBitmapbar6, 10, 340);
layoutChild( timerCount , maxWidth, maxHeight);
setPositionChild( timerCount , 274, 443);
setExtent(Display.getWidth(),Display.getHeight());
}
};
_vfm.add(mybitmapstartField) ;
_vfm.add(mybitmapresetField) ;
_vfm.add(mybitmapfinishField) ;
_vfm.add(mybitmaplogoField) ;
_vfm.add(mybitmapm1Field) ;
_vfm.add(mybitmapleftyrField) ;
_vfm.add(mybitmaprightyrField) ;
_vfm.add( mybitmaphowtoField) ;
_vfm.add(timerCount) ;
_vfm.add(backgroundBitmapbar1) ;
_vfm.add(backgroundBitmapbar2) ;
_vfm.add(backgroundBitmapbar3) ;
_vfm.add(backgroundBitmapbar4) ;
_vfm.add(backgroundBitmapbar5) ;
_vfm.add(backgroundBitmapbar6) ;
this.add(_vfm);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您调用 setPositionChild 时,重置字段的坐标为 0,起始字段的坐标为 140,结束字段的坐标为 280。您需要将字段的坐标设置为 140 到 280 之间的值,或者更改其他坐标。
You're calling setPositionChild with a 0 coordinate for the reset field, a 140 coordinate for the start field, and a 280 coordinate for the finish field. You need to set the field's coordinate to something between 140 and 280, or else change the other coordinates.