Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 7
Registered: ‎07-16-2008
My Device: Not Specified
Accepted Solution

hide shadow onfocus

i have a bitmap but when i get the focus it appears a shadow i dont want this happen. this is my code

 

   

bfMeeting = new BitmapField(meeting,BitmapField.FOCUSABLE){ protected boolean navigationClick(int status, int time){ doAction(); return true; } protected void onFocus(int direction){ setBitmap(meeting_focus); invalidate(); } protected void onUnfocus(){ super.onUnfocus(); setBitmap(meeting_unfocus); invalidate(); } protected void drawFocus(Graphics g, boolean on) { super.drawFocus(graphics, false); } };

 

 

 

any suggestion???

 

 

BlackBerry Development Advisor
Posts: 15,727
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: hide shadow onfocus

Transparent regions of an image are highlighted when using a BitmapField.  You can use an image without transparency and switch the image to show the user the focus has changed.  This link has an example.

 

How To - Show focus changes using BitmapField
Article Number: DB-00427

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800345/...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 7
Registered: ‎07-16-2008
My Device: Not Specified

Re: hide shadow onfocus

yeah i follow that tutorial, the problem isnt that i can put the image when i get the focus, the problem is that it put a white shadow too. am i doing something wrong??

 

image error 

Highlighted
BlackBerry Development Advisor
Posts: 15,727
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: hide shadow onfocus

Transparent areas of an image are highlighted on a BitmapField with focus.  Are the white areas you are pointing out transparent on your image?  If so, filling them with a colour instead of a transparent region should prevent this.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker