Search This Blog

Showing posts with label How To Add New Line In Label. Show all posts
Showing posts with label How To Add New Line In Label. Show all posts

Wednesday, 14 October 2020

How to Add New Line in Label Xamarin Forms.

 MainPage.xaml

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:TestProject"
             xmlns:system="clr-namespace:System;assembly=netstandard"       
             x:Class="TestProject.MainPage">
	      <StackLayout Margin="10">
		<Label>
                    <Label.FormattedText>
                        <FormattedString>
                            <Span Text="FirstLine text" />
                            <Span Text="{x:Static system:Environment.NewLine}"/>
                            <Span Text="{SecondLine text" />
                        </FormattedString>
                    </Label.FormattedText>
                </Label>
             </StackLayout>
</ContentPage>
 

Popular Posts