简体   繁体   English

如何在Blackberry中创建类似日历的ListView或TableView

[英]how to create ListView or TableView like calendar in blackberry

how can i create a view like calendar in blackberry and every list have a different color (example : blue for odd row and white for even-numbered row). 我如何在Blackberry中创建类似于日历的视图,并且每个列表都有不同的颜色(例如:蓝色表示奇数行,白色表示偶数行)。

I want a structure like below 我想要一个像下面的结构

text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text text | 文字文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text text | 文字文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text text | 文字文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text text | 文字文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text text | 文字文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text text | 文字文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text text | 文字文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text | 文字| text 文本

other sample, like an image in this link --> http://appworld.blackberry.com/webstore/content/14535/ 其他示例,例如此链接中的图片-> http://appworld.blackberry.com/webstore/content/14535/

i use blackberry jde 4.7. 我使用黑莓jde 4.7。 thanks 谢谢

Try this - 尝试这个 -

int k;
LabelField l;

GridFieldManager grid = new GridFieldManager(9,4,0); //First parameter for row,second for column
    for (int i = 1; i < 37; i++) {
        k=i%2;
         if(k!=0){
             l=new LabelField(""+i)
             {
                 public void paint(Graphics graphics)
                 {
                 graphics.setColor(Color.RED);
                 super.paint(graphics);
                 }
             } ;
         }else{
             l=new LabelField(""+i)
             {
                 public void paint(Graphics graphics)
                 {
                 graphics.setColor(Color.BLUE);
                 super.paint(graphics);
                 }
             } ;
         }

         grid.add(l);

    }
     grid.setColumnPadding(30);
     grid.setRowPadding(30);
     add(grid);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM