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
Highlighted
Developer
Posts: 206
Registered: ‎05-15-2012
My Device: None
My Carrier: Telus

Container height with multiline label does not behave correctly

[ Edited ]

When I put a multiline label inside of a container with no layout manager set (so presumably it has stack layout  by default) the container will not increase in size big enough to show all of the multiline label text. I have no height restrictions, or even preferred heights, set on any of the objects.

 

Container *centerTopContainer = new Container();
centerTopContainer->setMinWidth(483.0f);
centerTopContainer->setMinHeight(100.0f);

m_Title = Label::create().text("TITLE1").textStyle(m_TitleStyle).multiline(true);
m_Title->setHorizontalAlignment(HorizontalAlignment::Left);
m_Title->setVerticalAlignment(VerticalAlignment::Top);
m_Title->setRightPadding(3.0f);

 I later set the label text to a variable in an updateItem call (this class is a CustomControl).

 

Interestingly (perhaps) the "centerTopContainer" container does proportionally increase in size based on how much text is in the label. However, it never increases to a large enough size to show every line of the multiline label (it usually shows about 2/3 of the lines necessary).

 

Does anybody know what the cause of this behavior could be?

----------------------
Check out my app, Alien Flow for reddit

And of course, like my post if you found it helpful or informative!
Developer
Posts: 206
Registered: ‎05-15-2012
My Device: None
My Carrier: Telus

Re: Container height with multiline label does not behave correctly

Anybody have any ideas?

----------------------
Check out my app, Alien Flow for reddit

And of course, like my post if you found it helpful or informative!