10-08-2009 04:00 AM
i am trying to add the Background image to the VerticalFieldManger and adding it to the top of the screen as title or banner bez i want the hyperlink on that Background image.
For Ex:
The following code is what m using
_backgroundBitmap = Bitmap.getBitmapResource("logo2.jpg");
titleManager = VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR)
{
protected void paintBackground(Graphics graphics)
{
System.out.println("am in paintBackground");
graphics.clear();
graphics.drawBitmap(0, 0, 480,71, _backgroundBitmap, 0, 0);
super.paintBackground(graphics);
}
};
add(titleManager);
hManager.add(tab1);
hManager.add(spacer1);
hManager.add(tab2);
hManager.add(spacer2);
hManager.add(tab3);
add(hManager);
all other fields are getting added to the screen except the titleManager , please help me ...
10-08-2009 06:07 PM
Try with overriding sublayout() method inside the titleManager.
Something like:
titleManager = VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR)
{
protected void paintBackground(Graphics graphics)
{
graphics.clear();
graphics.drawBitmap(0, 0, 480,71, _backgroundBitmap, 0,
0);
super.paintBackground(graphics);
}
protected void sublayout( int maxWidth, int maxHeight )
{
int width = Display.getWidth();
int height = _backgroundBitmap.getHeight();
super.sublayout( width, height);
setExtent( width, height);
}
};
Regards
Bikas
10-09-2009 04:55 AM
Hi Bikas,
It worked and i really thanks to u.
Currently m working on project its UI is more related to the facebook appln. if u have any idea about the applications like viigo, facebook and poynt specially abt UI development part, if you dont mind can u share some knowledge about these, are these application devlopers having there own apis and framework or BB apis are enough to devlope those applns(i dnt think BB apis are enough).
Is there any Tutorials are available on net which will help to devlop these applns and if you knw any special online training for BB or any CD,DVDs of training(Paid will also do) .
pls help me with this.....
Thanks,
10-14-2009 08:21 AM
10-14-2009 08:53 AM
10-16-2009 12:31 AM
10-16-2009 12:32 AM
10-16-2009 05:06 AM
Bikas's code works perfectly.. I ve got one question though.. We got a picture in the manager as the background.. Now say we have a screen with say 4 different managers. What if we need one background image for the whole screen. How would we go abt it.. Would it work if instead of adding it to the manager , we add it to the screen ??
10-16-2009 05:54 AM
In that case,what you can do ,take a VeticalFieldManager as Main Manager and call paintbackground method and add all the 4 managers to it .
10-16-2009 06:18 AM - edited 10-16-2009 06:24 AM
Nope.. It doesnt work that way.. I tried. the rest of the image is not seen where the other managers have been added to the main vertical manager. Maybe if we could set some sort of transparency attribute to the other managers being added or something like that , but i dont thing there is anything of that type there..
Edit: And it doesnt work if we add it to the screen either...![]()