Skip to content

Commit d95493b

Browse files
[samples] UI tweaks to Xamarin samples (#1434)
These are just general UI improvements to the sample. Which is still admittedly, a bit ugly. * Use a `Padding` for the entire page on iOS, to accomodate an iOS device/simulator with the "notch". * Use a valid mono-spaced font on iOS: `Courier` * Use `Margin` instead of `Padding` on the "Run" button. The wrong property was used before.
1 parent ccdf229 commit d95493b

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

samples/BenchmarkDotNet.Samples.Forms/MainPage.xaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
mc:Ignorable="d"
77
x:Class="BenchmarkDotNet.Samples.Forms.MainPage">
8+
<ContentPage.Padding>
9+
<OnPlatform x:TypeArguments="Thickness">
10+
<OnPlatform.Platforms>
11+
<On Platform="iOS" Value="0,44,0,0" />
12+
</OnPlatform.Platforms>
13+
</OnPlatform>
14+
</ContentPage.Padding>
815
<Grid RowSpacing="0">
916
<Grid.RowDefinitions>
1017
<RowDefinition Height="Auto" />
@@ -13,14 +20,22 @@
1320
<Button
1421
x:Name="Run"
1522
Text="Run"
16-
Padding="10,10,10,0"
23+
Margin="10,10,10,0"
1724
Clicked="Button_Clicked" />
1825
<ScrollView Orientation="Both" Grid.Row="1">
1926
<Label
2027
x:Name="Summary"
2128
Grid.Row="1"
22-
Padding="10"
23-
FontFamily="monospace" />
29+
Padding="10">
30+
<Label.FontFamily>
31+
<OnPlatform x:TypeArguments="x:String">
32+
<OnPlatform.Platforms>
33+
<On Platform="Android" Value="monospace" />
34+
<On Platform="iOS" Value="Courier" />
35+
</OnPlatform.Platforms>
36+
</OnPlatform>
37+
</Label.FontFamily>
38+
</Label>
2439
</ScrollView>
2540
<ActivityIndicator
2641
x:Name="Indicator"

0 commit comments

Comments
 (0)