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

Native Development

Reply
Contributor
Posts: 34
Registered: ‎12-20-2010
My Device: DevAlpha Beta 2
My Carrier: Orange

TextField hintText on 2 lines

Hello everyone,

 

I'm facing a little problem on my Blackberry 10 Cascade app.

I have a TextField and the hintText is a little bit too long to fit into the TextField.

Instead of being cut at then end (which would be the behaviour I expected), the hintText is split in 2 lines (the second line being cut since it doesn't fit in the TextField in height).

I could change my hintText so that it fits but the TextField can be resized in my UI. Plus, I would like to have something that works great for all screen sizes.

 

Anybody has a solution ?

 

Thank you!

Highlighted
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: TextField hintText on 2 lines

Hint text is best suited for short hints. I usually place long descriptions below TextField in a Label with gray color and smaller font like in device Settings menus. The label can be multiline.

 

To simplify reuse I created a CustomControl subclass which contains a title, a textfield (or another control) and a description with 3 setters: setTitle, setValue, setDescription. When title is empty, the title label is hidden etc.

 


Andrey Fidrya, @zmeyc on twitter