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
Developer
Posts: 253
Registered: ‎08-14-2010
My Device: Not Specified

setFont effect

Hi ,

 

when you use setFont in Manager or a Screen does it affect to childerens too?

 

Thanks in Adavance

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: setFont effect

no, it is inherited from field, so it affects only the object it is called on.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 107
Registered: ‎05-26-2011
My Device: Torch
My Carrier: Mobilink

Re: setFont effect

 

as Simon said

u need to call field.setFont(_fontinstance) for all child field in screen or manager.

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: setFont effect

probably easier to use http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/ui/FontManager.html#setApplica... then (or setDefaultFont pre 5.0)
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: setFont effect

"when you use setFont in Manager or a Screen does it affect to children too?"

 

In fact I believe Simon is not correct here.  In my experience and testing, when you call setFont, it is reflected in the Field on which it is set, and all children of that Field (assuming they do not have their own Font specified).

 

So for example, if you have a Screen containing a number of Fields that do not have Fonts set, and you setFont() on the Screen, all the children will in fact immediately change Font.

 

Similarly it is easy to set all the Fields in a Manager to use one Font just by setting the Font for the Manager. 

 

Give it a try.