Skip to content

Instantly share code, notes, and snippets.

@mattleibow
Created August 26, 2020 16:22
Show Gist options
  • Save mattleibow/641614e900cf35bdf5decc13c15ff215 to your computer and use it in GitHub Desktop.
Save mattleibow/641614e900cf35bdf5decc13c15ff215 to your computer and use it in GitHub Desktop.
<?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="ViewScalingTranslatingTests.MainPage">
<ContentPage.Resources>
<ResourceDictionary>
<Style TargetType="Button">
<Setter Property="HorizontalOptions" Value="Start" />
<Setter Property="WidthRequest" Value="100" />
<Setter Property="BackgroundColor" Value="Gray" />
<Setter Property="FontSize" Value="12" />
<Setter Property="HeightRequest" Value="32" />
<Setter Property="Padding" Value="0" />
</Style>
<Style TargetType="BoxView">
<Setter Property="VerticalOptions" Value="Fill" />
<Setter Property="HorizontalOptions" Value="Start" />
<Setter Property="WidthRequest" Value="1" />
<Setter Property="Color" Value="LightGray" />
</Style>
<Style TargetType="Label">
<Setter Property="HorizontalOptions" Value="Start" />
</Style>
</ResourceDictionary>
</ContentPage.Resources>
<Grid>
<BoxView Margin="0,0,0,0" />
<BoxView Margin="50,0,0,0" />
<BoxView Margin="100,0,0,0" Color="Black" />
<BoxView Margin="150,0,0,0" />
<BoxView Margin="200,0,0,0" Color="Black" />
<BoxView Margin="250,0,0,0" />
<BoxView Margin="300,0,0,0" Color="Black" />
<BoxView Margin="350,0,0,0" />
<Grid>
<Label Text="0" />
<Label Text="50" Margin="50,0,0,0" />
<Label Text="100" Margin="100,0,0,0" />
<Label Text="150" Margin="150,0,0,0" />
<Label Text="200" Margin="200,0,0,0" />
<Label Text="250" Margin="250,0,0,0" />
<Label Text="300" Margin="300,0,0,0" />
<Label Text="350" Margin="350,0,0,0" />
</Grid>
<ScrollView>
<Grid>
<StackLayout Margin="0,30" Spacing="30">
<StackLayout>
<Label />
<BoxView Color="Red" Margin="0,0,0,0" WidthRequest="100" HeightRequest="32" />
<BoxView Color="Red" Margin="-50,0,0,0" WidthRequest="200" HeightRequest="32" />
<BoxView Color="Red" Margin="0,0,0,0" WidthRequest="200" HeightRequest="32" />
<Label />
<BoxView Color="Red" Margin="200,0,0,0" WidthRequest="100" HeightRequest="32" />
<BoxView Color="Red" Margin="150,0,0,0" WidthRequest="200" HeightRequest="32" />
<BoxView Color="Red" Margin="200,0,0,0" WidthRequest="200" HeightRequest="32" />
</StackLayout>
</StackLayout>
<StackLayout Margin="0,30" Spacing="30">
<StackLayout>
<Label Text="simple scale" HorizontalOptions="Center" BackgroundColor="#AAFFFFFF" />
<Button Text="default" ScaleX="1" TranslationX="0" />
<Button Text="scale 2x" ScaleX="2" TranslationX="0" />
<Button Text="left scale 2x" ScaleX="2" TranslationX="0" AnchorX="0" />
<Label Text="Scale then translate to 200" HorizontalOptions="Center" BackgroundColor="#AAFFFFFF" />
<Button Text="default" ScaleX="1" TranslationX="200" />
<Button Text="scale 2x" ScaleX="2" TranslationX="200" />
<Button Text="left scale 2x" ScaleX="2" TranslationX="200" AnchorX="0" />
</StackLayout>
</StackLayout>
</Grid>
</ScrollView>
</Grid>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment