Dmitry
Dmitry

Reputation: 161

BlackBerry API 6.0. How to make a LabelField wider (to make it stop enforcing new lines)?

I have a class which extends LabelField to set font and color. I have 2 such custom LabelFields and they display some strings of text. Those Strings are rather short, about a dozen symbols long.

The problem is that these custom LabelFields enforce new lines. They break my strings and display them in 2 lines instead of only 1 (no matter if a String is 6 or 12 characters long).

How to make these LabelFields stop enforcing new lines? I need to have one line stay one line.

Update: I have found the reason of that problem. The problem was on another level, - in the process of calculation of width and height for my popup Screen which contained those LabelFields.

Upvotes: 0

Views: 275

Answers (1)

Vivek Kumar Srivastava
Vivek Kumar Srivastava

Reputation: 2158

you can use the style LabelField.ELLIPSIS to force the single line.

like

LabelField l = new LabelField("your text",LabelField.ELLIPSIS);

Upvotes: 2

Related Questions