Saturday, 4 November 2017

Xamarin Forms Label Borders [Tutorial 31]

Step1: We Have to Just Define our MainPage.xaml

<ContentPage.Resources>
<ResourceDictionary x:Name="AppDictionary">
<Color x:Key="BackgroundColor">#000000</Color>
<Color x:Key="BorderColor">#E1E1E1</Color>
<Style x:Key="InternalViewStyle" TargetType="ContentView">
<Setter Property="BackgroundColor" Value="{StaticResource BackgroundColor}"/>
<Setter Property="VerticalOptions" Value="Fill"/>
</Style>
<Style x:Key="BorderStyle" TargetType="ContentView">
<Setter Property="BackgroundColor" Value="{StaticResource BorderColor}"/>
<Setter Property="Padding" Value="3,1,1,3"/>
</Style>
</ResourceDictionary>
</ContentPage.Resources>
<ContentView Padding="20" VerticalOptions="Center" HorizontalOptions="Center">
<ContentView Style="{StaticResource BorderStyle}" >
<ContentView Style="{StaticResource InternalViewStyle}">
<Label Text="I am Border 1!"
FontSize="20" TextColor="White"
HorizontalOptions="Center"></Label>
</ContentView>
</ContentView>
</ContentView>
view raw MainPage.xaml hosted with ❤ by GitHub
Step2:Holaaa No more Steps!!!

No comments:

Post a Comment