Add Blaxamarin sample AboutPage
Uses new Label.FormattedText support
This commit is contained in:
Родитель
83b7859728
Коммит
a0dba14ded
|
@ -0,0 +1,65 @@
|
|||
@using Xamarin.Essentials
|
||||
|
||||
<StackLayout>
|
||||
<StackLayout Orientation="StackOrientation.Horizontal">
|
||||
@*<ContentView Padding="0,40,0,40" VerticalOptions="FillAndExpand">
|
||||
<Image Source="xamarin_logo.png" VerticalOptions="Center" HeightRequest="64" />
|
||||
</ContentView>*@
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
<ScrollView>
|
||||
<StackLayout Orientation="StackOrientation.Vertical">
|
||||
<Label FontSize="22">
|
||||
<FormattedText>
|
||||
<FormattedString>
|
||||
<Spans>
|
||||
<Span Text="AppName" FontAttributes="FontAttributes.Bold" FontSize="22" />
|
||||
<Span Text=" " />
|
||||
<Span Text="1.0" ForegroundColor="@lightTextColor" />
|
||||
</Spans>
|
||||
</FormattedString>
|
||||
</FormattedText>
|
||||
</Label>
|
||||
<Label>
|
||||
<FormattedText>
|
||||
<FormattedString>
|
||||
<Spans>
|
||||
<Span Text="This app is written in C# and native APIs using the" />
|
||||
<Span Text=" " />
|
||||
<Span Text="Xamarin Platform" FontAttributes="FontAttributes.Bold" />
|
||||
<Span Text="." />
|
||||
</Spans>
|
||||
</FormattedString>
|
||||
</FormattedText>
|
||||
</Label>
|
||||
<Label>
|
||||
<FormattedText>
|
||||
<FormattedString>
|
||||
<Spans>
|
||||
<Span Text="It shares code with its" />
|
||||
<Span Text=" " />
|
||||
<Span Text="iOS, Android, and Windows" FontAttributes="FontAttributes.Bold" />
|
||||
<Span Text=" " />
|
||||
<Span Text="versions." />
|
||||
</Spans>
|
||||
</FormattedString>
|
||||
</FormattedText>
|
||||
</Label>
|
||||
<Button Text="Learn more"
|
||||
OnClick="@OpenWeb"
|
||||
BackgroundColor="@primaryColor"
|
||||
TextColor="Color.White" />
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
|
||||
@code
|
||||
{
|
||||
Color primaryColor = Color.FromHex("2196F3");
|
||||
Color accentColor = Color.FromHex("96d1ff");
|
||||
Color lightTextColor = Color.FromHex("999999");
|
||||
|
||||
async Task OpenWeb()
|
||||
{
|
||||
await Launcher.OpenAsync(new Uri("https://xamarin.com/platform"));
|
||||
}
|
||||
}
|
|
@ -8,4 +8,8 @@
|
|||
<ContentPage Title="Counter">
|
||||
<Counter />
|
||||
</ContentPage>
|
||||
<ContentPage Title="About">
|
||||
<About />
|
||||
</ContentPage>
|
||||
</TabbedPage>
|
||||
|
Загрузка…
Ссылка в новой задаче