专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > BlackBerry

[急]黑莓向可滚动的VerticalFieldManager添加ButtonField,导致屏幕错误

发布时间:2010-05-30 19:36:47 文章来源:www.iduyao.cn 采编人员:星星草
[急]黑莓向可滚动的VerticalFieldManager添加ButtonField,导致屏幕异常

package com.test;

import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;

public class ManagerScreen extends MainScreen {

private VerticalFieldManager bodyManager,b1,b2,b3,b4,b5,b6;
private ButtonField bt1,bt2,bt3,bt4,bt5,bt6;
private ButtonField bt11,bt22,bt33,bt44,bt55,bt66;
private int i;

public ManagerScreen() {
HorizontalFieldManager t = new HorizontalFieldManager(){
protected void paintBackground(Graphics g) {
// TODO Auto-generated method stub
g.setColor(Color.GRAY);
g.fillRect(0, 0, Display.getWidth(), Display.getHeight()/4/2);
super.paintBackground(g);
}
protected void sublayout(int maxWidth, int maxHeight) {
// TODO Auto-generated method stub
maxWidth = Display.getWidth();
maxHeight = Display.getHeight()/4/2;
super.sublayout(maxWidth, maxHeight);
setExtent(maxWidth, maxHeight);
}
};

HorizontalFieldManager f = new HorizontalFieldManager(){
protected void paintBackground(Graphics g) {
// TODO Auto-generated method stub
g.setColor(Color.GRAY);
g.fillRect(0, 0, Display.getWidth(), Display.getHeight()/4/2);
super.paintBackground(g);
}
protected void sublayout(int maxWidth, int maxHeight) {
// TODO Auto-generated method stub
maxWidth = Display.getWidth();
maxHeight = Display.getHeight()/4/2;
super.sublayout(maxWidth, maxHeight);
setExtent(maxWidth, maxHeight);
}
};

bodyManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL|Manager.VERTICAL_SCROLLBAR){
protected void sublayout(int maxWidth, int maxHeight) {
// TODO Auto-generated method stub
maxWidth = Display.getWidth();
maxHeight = Display.getHeight()-Display.getHeight()/4;
super.sublayout(maxWidth, maxHeight);
setExtent(maxWidth, maxHeight);
}
};
bt1 = new ButtonField("bt1",ButtonField.CONSUME_CLICK);
bt11 = new ButtonField("bt11",ButtonField.CONSUME_CLICK);
bt2 = new ButtonField("bt2",ButtonField.CONSUME_CLICK);
bt22 = new ButtonField("bt22",ButtonField.CONSUME_CLICK);
bt3 = new ButtonField("bt3",ButtonField.CONSUME_CLICK);
bt33 = new ButtonField("bt33",ButtonField.CONSUME_CLICK);
bt4 = new ButtonField("bt4",ButtonField.CONSUME_CLICK);
bt44 = new ButtonField("bt44",ButtonField.CONSUME_CLICK);
bt5 = new ButtonField("bt5",ButtonField.CONSUME_CLICK);
bt55 = new ButtonField("bt55",ButtonField.CONSUME_CLICK);
bt6 = new ButtonField("bt6",ButtonField.CONSUME_CLICK);
bt66 = new ButtonField("bt66",ButtonField.CONSUME_CLICK);
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: