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
Highlighted
Developer
Posts: 813
Registered: ‎05-29-2012
My Device: see later
My Carrier: see later
Accepted Solution

Font height

Hello, I used the very famous http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800508/... to create tabs

 

But the tabs are too small, so I want to higher there height..

I did this

 

tab1 = new LabelField("Top20", LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT)
            {
                protected boolean navigationClick(int status,int time){
                   
                    return true;
                }
                protected void layout(int width, int height) {
                    super.layout(width, height);
                    this.setExtent(this.getWidth(), 60);
                }
            };

 

 

But problem is, top 20 is printed and underneath it much space.how can i make the font size height as big as the tab height?

Developer
Posts: 78
Registered: ‎05-17-2012
My Device: 9900 - OS 7.0 Torch device
My Carrier: Reliance

Re: Font height

Hi

 

Have you tried with this

 

tab1.setFont(Font.getDefault().derive(Font.PLAIN,18)); Here 18 would be the font size, you can alter w.r.t your requirement.

Developer
Posts: 813
Registered: ‎05-29-2012
My Device: see later
My Carrier: see later

Re: Font height

It also largens the width, and u have the tab out of screen
Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Font height

don't use setExtent after super.layout, it messes up the internal processing, even if you don't see any side effects in this case.

for simple layout issues you can use setPadding or setMargin.
----------------------------------------------------------
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