The 2nd Span gets hidden while using the following code:
<Button>
<FormattedString>
<Span text="12345�
"></Span>
<Span text="Line 2"></Span>
</FormattedString>
</Button>
This code works as expected in Android.
To be able to render the text from both Spans in separate lines you should use \n, which will break the line as expected for both iOS and Android.
For example:
<Button textWrap="true">
<FormattedString>
<Span [text]="title" fontSize="14" ></Span>
<Span class="menu-text" [text]="label ? '\n\n'+label : ''"></Span>
</FormattedString>
</Button>
The \n only works when we use the property binding like this [text]="'12345\n'" but we could work around that by using 
 which is the ASCII for Line feed. Still the error exists even if I use the exact same code that you've provided.
Hi @Jai-Krish
Make sure that you are using latest CLI 3.0.3 and tns-core-modules 3.0.0. Similar issue with breaking the line is already reported here. However, the above-given workaround should be applicable. I am attaching sample project, where the solution with \n is shown.
For your convenience, I am also attaching snippet from the simulator.
Archive.zip

Thank you! updating the CLI fixed the problem but in iOS the text always aligns to left even if I set text-align: center
Hi @Jai-Krish,
text-alignment center should work as expected without any further setting, Something that could cause this behavior could be related to some letter-spacing at the begging of the text Span.
Please verify, whether there are some spacing and if so remove it from the text.
The class text-center works in Label with FormattedString but not with Button. Here is a snippet of this Archive.zip
Hi @Jai-Krish,
Indeed this is an issue in the current official version and setting up text-align will not be respected, while using formatted string for a button.
However, this behavior has been fixed in the upcoming release and you could test it on your side while using @next tag.
Steps:
tns plugin remove tns-core-modulesnpm install tns-core-modules@next --saveplatforms and node_modules foldersAfter those steps the style="text-align:center;" should also work for this component
<ActionBar title="My App" class="action-bar">
</ActionBar>
<StackLayout class="page">
<Button style="text-align:center;" textWrap="true">
<FormattedString >
<Span [text]="'12345'" fontSize="14" ></Span>
<Span class="menu-text" [text]="'\nLabel2'"></Span>
</FormattedString>
</Button>
</StackLayout>
textWrap="true" is the magic sauce here... missed that the first time.
I found a way of getting it to work on both Android and iOS and in my instance picked up that when there is a line break (Both HTML formated or ANCII) inside the span containing the text or icon the text disappears on iOS. The below worked perfectly for me.
.font-icon-btn
{
width: 110;
height: 100;
color: #999999;
text-align: center;
}
.img-button-text {
width: 80;
height: 60;
border-radius: 10;
margin:7;
color: #999999;
}
<Button class="font-icon-btn" visibility="{{ FoodandWine }}" textWrap="true">
<Button.formattedText>
<FormattedString>
<FormattedString.spans>
<Span text="" fontFamily="FontAwesome" fontSize="40" />
<Span text="
" fontSize="20" />
<Span text="
" fontSize="10" />
<Span text="Food and Wine" class="img-button-text" fontSize="12" textWrap="false"/>
</FormattedString.spans>
</FormattedString>
</Button.formattedText>
</Button>
Hi @Jai-Krish, I have tested your scenario on my side with tns-core-modules@next and it seems that the issue is already fixed. Please have in mind in order to achieve this you need to set textWrap=true as @vance has mentioned before.
<Button textWrap="true" >
<FormattedString>
<Span text="12345�
"></Span>
<Span text="Line 2"></Span>
</FormattedString>
</Button>
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
textWrap="true" is the magic sauce here... missed that the first time.