05-22-2012 06:46 PM
Solved! Go to Solution.
05-22-2012 07:11 PM
Hi
There is two for this.
1) set an images a title.
setTitle(new BitmapField(Bitmap.getBitmapResource("icon.png)));
2) Take two manager,
Add image in first manager, and rest thing (UI) add in other manager, and make scrollable the second manager only, so that first manager will not get scroll.
Thanks
Pawan
05-22-2012 08:37 PM
05-22-2012 09:19 PM
Here is the effect I am trying to acheive.
The screen would scroll like a ListObject but the Title Area and Black area would not scroll.
i.e., theListObject would scroll under the black area.
05-24-2012 05:03 AM - edited 05-24-2012 12:59 PM
See the following KB article to understand how to do this:
http://supportforums.blackberry.com/t5/Java-Develo
In brief, you will add the title area as a banner (setBanner) and you will add a non scrolling VerticalFieldManager to the MainScreen that has the bitmap map with the black corner as a background. Then you will add a scrolling VerticalFieldManager to the non scrolling one and add the ListField to that.
Actually that is how you would do it normally, but there is a problem with ListField in that each row typically paints itself completely. I have never tried to have the rows 'transparent' and that might have readability issues with some of the data. but give it a go and see how it turns out.
Good luck
Edit: Apologies, I missed this comment:
" theListObject would scroll under the black area"
See what arkadyz has to say below.
05-24-2012 11:25 AM
05-24-2012 11:50 AM
In this specific case you'll have to override paint of your non-scrolling Manager. I hope your Bitmap is transparent - otherwise it will completely obscure the contents of the screen
.
Something like this should solve your problem:
1. Create your MainScreen with NO_VERTICAL_SCROLL flag (read the article Peter mentioned for explanation).
2. Add the top part of the screen as a banner using MainScreen's setBanner (setTitle has its own problems - again, read that article).
3. Add a non-scrolling Manager (either VerticalFieldManager or HorizontalFieldManager will work) with USE_ALL_HEIGHT and USE_ALL_WIDTH to the screen. This manager will override its paint like this:
protected void paint(Graphics g) {
super.paint(g);
g.drawBitmap(0, 0, yourBitmap.getWidth(), yourBitmap.getHeight(), yourBitmap, 0, 0);
}
4. Add a VERTICAL_SCROLL (and optionally VERTICAL_SCROLLBAR) VerticalFieldManager to the Manager above.
5. Add your ListField to this vertically scrolling manager.
If your Bitmap gets distorted on gesture scrolling on touchscreen devices, you will have to add a scroll listener to the scrolling manager and invalidate the non-scrolling one with the overridden paint inside scrollChanged.
See if it works. Good luck!
05-24-2012 06:29 PM
05-25-2012 05:29 AM
05-25-2012 06:29 AM