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

Adobe AIR Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 275
Registered: ‎01-21-2013
My Device: BB10 Dev Aplha
My Carrier: -

Problems in Multiline Label: BB10

I want to create a scrollable Lable, that will increase in height at runtime and it should allow the main container to scroll. I am using the Grid layout to allow the lable to allign within container. But the Label is always rendering as single line even if I have added 'maxLines = 0'. But if I add the text with '\n' , it renders correctly with new line and allows the container to scroll. But I don't want to add 'new line characters'. What is wrong in the following code

oMainContainer = new Container();
oMainContainer.scrollDirection = ScrollDirection.VERTICAL;
oMainContainer.height = stage.stageHeight;
oMainContainer.width = stage.stageWidth;
//
var oGridLay:GridLayout = new GridLayout();
oMainContainer.layout = oGridLay;
oGridLay.padding = 30;
//
var oAllignData:GridData = new GridData();
oAllignData.hAlign = Align.BEGIN;
oAllignData.vAlign = Align.FILL;
//
oOutput = new Label();
oOutput.text = "This is sample scrollable text. This is sample scrollable text. This is sample scrollable text. This is sample scrollable text. This is sample scrollable text. This is sample scrollable text. This is sample scrollable text. This is sample scrollable text. This is sample scrollable text. This is sample scrollable text. This is sample scrollable text. This is sample scrollable text. This is sample scrollable text. This is sample scrollable text. ";
//oOutput.text = "vsd sda vds av sadv \n adsv ads vsadvds vsd sda vds av sadv \n  adsv ads vsadvds vsd sda vds av sadv \n  adsv ads vsadvds vsd sda vds av \n  sadv adsv ads vsadvds vsd sda vds \n  av sadv adsv ads vsadvds vsd sda vds \n av sadv adsv ads vsadvds vsd sda \n  vds av sadv \n  adsv ads vsadvds vsd sda vds av sadv \n adsv ads vsadvds vsd sda vds av sadv \n  adsv ads vsadvds vsd sda vds av sadv \n  adsv ads vsadvds vsd sda vds av \n  sadv adsv ads vsadvds vsd sda vds \n  av sadv adsv ads vsadvds vsd sda vds \n av sadv adsv ads vsadvds vsd sda \n  vds av sadv \n  adsv ads vsadvds ";
oOutput.maxLines = 0;
oOutput.layoutData = oAllignData;
oMainContainer.addChild(oOutput);
this.addChild(oMainContainer);
Highlighted
Developer
Posts: 121
Registered: ‎01-21-2011
My Device: Z10 LE #00055
My Carrier: Telus

Re: Problems in Multiline Label: BB10

It looks like you didn't set a width for the label, try setting oOutput.width = oMainContainer.width.

VENTURCON
For BB10: e-Mmanuel Bible Reader, e-Mmanuel Audio Bible, PM Assist
For PlayBook: e-Mmanuel Bible Reader, Business Analysis Toolbox
Developer
Posts: 275
Registered: ‎01-21-2013
My Device: BB10 Dev Aplha
My Carrier: -

Re: Problems in Multiline Label: BB10

I guess, I am not required to set the width as I am using the layout. Even if I set the width, it does not work.

 

Interestingly if I change the layout to 'StackLayout'   and 'StackData', I get the multiline text.

 

Is this an issue with Grid layout, I have to use the label in Grid layout only.

Developer
Posts: 275
Registered: ‎01-21-2013
My Device: BB10 Dev Aplha
My Carrier: -

Re: Problems in Multiline Label: BB10

Hasn't anyone came across this issue?