EP02 Xamarin Forms Labels

Dec 20, 2021 | Xamarin Forms

in this tutorial i will show you how to use Label in Xamarin Forms

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Labels.MainPage">

    <StackLayout>
        <Label Text="Welcome"
               FontSize="30"
               TextColor="Black"
               BackgroundColor="Green"
               FontAttributes="Bold"
               WidthRequest="100"
               HeightRequest="100"
               VerticalTextAlignment="center"
               HorizontalTextAlignment="Center"
               TextDecorations="Strikethrough"

               />
        <Label Text="Welcome to Xamarin Forms Welcome to Xamarin Forms Welcome to Xamarin Forms Welcome to Xamarin Forms"
               FontSize="30"
               TextColor="White"
               BackgroundColor="Black"
               Margin="10"
               Padding="10"
               LineHeight="2"
               CharacterSpacing="1.5"
               LineBreakMode="WordWrap"
               MaxLines="4"
               Opacity="0.5"
               IsVisible="true"
                       />

    </StackLayout>

</ContentPage>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

namespace Labels
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
        }
    }
}
EP02 Xamarin Forms Labels

GitHub : https://github.com/nady2999/Xamarin-Forms-Labels

Pin It on Pinterest

Share This