04-01-2009 02:51 AM
I am making a custom header field and using screen's
public void setTitle(Field arg0)
to connect it to my screen.
Now the question is how to get the same font that the title would be set on in a Default header field ?
I would like my header to be Theme dependent so I need to set the font dynamically.
How can I know which font (+ size, colour and style) is used in Default header fields ?
I tried creating a dummy screen and to retrieve its header field information, but it seems that the header field is not created until the screen is actually pushed on top
Anyone has a clue ?
Solved! Go to Solution.
04-01-2009 03:33 AM - edited 04-01-2009 03:33 AM
Why not use like this?
Font f = Font.getDefault();
04-01-2009 05:06 AM
At first I was a bit suspicious about this simple answer.
But as it turns out that field actually got the native font family, colour and size. But it did not collect the style.
So this is what I had to do:
Does anyone know how to why simple
was not enough ?
Thanks for the hint mantaker.
04-01-2009 05:30 AM
Font.getDefault() derives the default font which is normally used in TextField, Labels etc.. For headers you need to make the font BOLD, even RIM would've did this for their applications which runs on BB..
04-01-2009 05:33 AM
"For headers you need to make the font BOLD"
This is a documented fact or an empirically derived rule ?
(I will of course use it, but just wondering .... )
Thanks again for the interest and info.
04-01-2009 05:37 AM - edited 04-01-2009 06:39 AM
Its just a sense, not a rule ..
Think this way, for a theme, there must be one default font.. Do you agree with that?
Well, If yes, then for header field, you want the same default font bolded, for the status bar, you need it to be italisized... This is according to the developer needs ..
Still have doubt??
Edit: Spelling mistake