• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

How can I layout out 3 labels horizontally, so they appear one after another in multiple lines

New Here ,
Oct 20, 2011 Oct 20, 2011

Copy link to clipboard

Copied

I have 3 labels in a container, I would like them appear one after another (make them like spans to the html, inline display), especially when the length of question label is very long and will need to occupy multiple lines.

following codes will have the effects appeared in the first image, and I would like them to look like the second image,
First Image:

worng.jpg

Second Image:

right.jpg

is there any ways to make it, it is simple task in html, but I could not fount out a solution for it.

thanks in advanced.


Below is the sample codes in Flex 4.5

<HGroup>

<s:Label text="Q1." styleName="qNum" />

<s:Label text="This question label is very long. sdfsldfjs sd flsjd flsjdfsdfljs dfojhikljsflksjdf  sldjfiosdjfosjdflsjdfl io3iweieirofsdjlsd fls jdfosdifjos dfljsdfs"  styleName="qLabel" />

<s:Label text="*"  styleName="qRequired" />

</HGroup>

TOPICS
Developers

Views

848

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 21, 2011 Oct 21, 2011

Copy link to clipboard

Copied

Pardon the formatting issues, this is through email.

Combining a question out of 3 labels seems a little trouble some. Here is a slightly modified version of yours.

<s:HGroup width="100%" horizontalAlign="left" gap="0">

<s:Label text="Q1." styleName="qNum" />

<s:Label text="This question label is very long. sdfsldfjs sd flsjd flsjdfsdfljs dfojhikljsflksjdf sldjfiosdjfosjdflsjdfl io3iweieirofsdjlsd fls jdfosdifjos dfljsdfs" styleName="qLabel" />

<s:Label text="*" styleName="qRequired" />

</s:HGroup>

Or maybe run together into one label... the newer TLF components can use the textFlow property to set formatted text. Such as a s:RichText instead of a label.

<fx:Script>

public sQuestion = " This question label is very long. sdfsldfjs sd flsjd";

public nQuestionNumber:int = 1;

</fx:Script>

<s:Label text="Q. *" /

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 24, 2011 Oct 24, 2011

Copy link to clipboard

Copied

Pardon the formatting issues, this is through email.

Combining a question out of 3 labels seems a little trouble some. Here is a slightly modified version of yours.

<s:HGroup width="100%" horizontalAlign="left" gap="0">

   <s:Label text="Q1." styleName="qNum" />

   <s:Label text="This question label is very long. sdfsldfjs sd flsjd flsjdfsdfljs dfojhikljsflksjdf  sldjfiosdjfosjdflsjdfl io3iweieirofsdjlsd fls jdfosdifjos dfljsdfs"  styleName="qLabel" />

   <s:Label text="*"  styleName="qRequired" />

</s:HGroup>
RE: This  modifition does not work

Or maybe run together into one label...  the newer TLF components can use the textFlow property to set formatted text. Such as a s:RichText instead of a label.


Re: TextFlow is not supported by Mobile devices

<fx:Script>

   public sQuestion = " This question label is very long. sdfsldfjs sd flsjd";

   public nQuestionNumber:int = 1;

</fx:Script>

<s:Label text="Q.  *" /
RE: seems this suggestio nis not fully complete, can you please provide me the full details?

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 27, 2011 Oct 27, 2011

Copy link to clipboard

Copied

LATEST

I hope it's not being stripped from my email replies. What is had was curly brackets with the variables inside it. So in the text quotes it said "Q[curlybracketopen] nQuestionNumber[curlybracketclose]. sQuestion[curlybracketclose] *". This would have combined the questions formatting using one label and some binding.

<fx:Script>

public sQuestion = " This question label is very long. sdfsldfjs sd flsjd";

public nQuestionNumber:int = 1;

</fx:Script>

<s:Label text="Q. *" />

Hope this one got through,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines