开发者

Scrolling issue with bitmap image field, Blackberry

开发者 https://www.devze.com 2022-12-22 08:42 出处:网络
working on BB 9000 hey in my screen there is a label field ,below it there is a bitmap field and below that there is a list field

working on BB 9000

hey in my screen there is a label field ,below it there is a bitmap field and below that there is a list field

when i scroll down all repainting is fine but when i scroll up from list field to Bitmap field

then my image does not gets repainted till i reach at the top most label field.

i am unable to figure out why it happens

the label field is set to focussable for some reasons...

making bitmap field as focussable does not also solves the problem

code :

LabelField lbl = new LabelField("Hello",Field.focussable)

detail_img = Bitmap.getBitmapResource("container.png");
detail_img_field = new BitmapField(detail_img);

 reviewlist =  new Review_List(my_vector); //Review_List is  a class that fills value in list field

 reviewlistManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL |Manager.VERTICAL_SCROLLBAR)
 {              

                 protected void paint(net.rim.device.api.ui.Graphics graphics)
                    {
                         super.paint( graphics );
                    }

                      protected boolean keyDown( int keycode, int status )
                        {
                           my_Screen.this.invalidate();
                            return super.keyDown( keycode, status );
                        }
                        protected boolean keyUp(int keycode, int time)
                        {
                            my_Screen.this.invalidate();
                            return super.keyUp(keycode, time);
                        }

                        protected boolean navigationMovement( int dx, int dy, int status, int time )
                        {
                            my_Screen.this.invalidate();
                            return super.navigationMovement( dx, dy, status, time );
                        }

                        protected int moveFocus(int amount, int status, int time)
                        {
                            my_Screen.this.invalidate();
                           return super.moveFocus(amount, status, time);
                        }
                        protected void onFocus(int direction)
                        {
                            my_Screen.this.invalidate();
                            super.onFocus(direction);
                        }
                        protected void onUnfocus() 
                        {
                            my_Screen.this.invalidate();
                            super.onUnfocus();
                        }

                };

reviewlist开发者_如何学运维Manager.add(reviewlist);
backgroundMannager.add(reviewlistManager);
add(backgroundMannager);


Is this on a simulator or real device? Sometimes simulators have rendering issues (such as not redrawing a region they should have) while the real device does not.


yuppieeeeee

i got the answer

i just placed the bitmap field inside a VerticalFieldManager,enabled with vertical scroll n my problem got solved...

code :

    rest_manager = new VerticalFieldManager(Manager.VERTICAL_SCROLL)
          {
            protected void paint(net.rim.device.api.ui.Graphics graphics)
             {
                  int y = this.getVerticalScroll();                                     
                                     graphics.drawBitmap( 0, y, rank_img.getWidth()+10, 
rank_img.getHeight(), rank_img, 0, 0 );

                                     super.paint( graphics );
                                }
                     }
0

精彩评论

暂无评论...
验证码 换一张
取 消