Skip to content

Commit

Permalink
add animated gif and workaround picker on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
davidortinau committed Apr 5, 2024
1 parent 0ea2971 commit 6f14c39
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
30 changes: 22 additions & 8 deletions src/ControlGallery/Pages/Controls/ImagePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,30 @@
<ContentPage.Content>
<ScrollView>
<VerticalStackLayout
Style="{StaticResource MainContainer}">
Style="{StaticResource MainContainer}"
Spacing="9">
<Label Text="Embedded Resource" Style="{StaticResource Headline}"/>
<Image x:Name="ImgTarget"
HeightRequest="100"
WidthRequest="100"/>

<Label Text="Image with 40x40 and #f1f1f1 bg"/>
<Label Text="Image with 40x40 and #f1f1f1 bg"
Style="{StaticResource Headline}"/>
<Image Source="dotnet_bot.png"
BackgroundColor="#f1f1f1"
HeightRequest="40" WidthRequest="40"/>

<Label Text="Image with AspectFill 40x100"/>
<Label Text="Image with AspectFill 40x100"
Style="{StaticResource Headline}"/>
<Image Source="dotnet_bot.png"
BackgroundColor="#f1f1f1"
HeightRequest="40"
WidthRequest="100"
Aspect="AspectFill"
/>

<Label Text="Image with AspectFit 40x100"/>
<Label Text="Image with AspectFit 40x100"
Style="{StaticResource Headline}"/>
<Image Source="dotnet_bot.png"
HeightRequest="40" WidthRequest="100"
BackgroundColor="#f1f1f1"
Expand All @@ -44,18 +48,21 @@
Aspect="Center"
/>-->

<Label Text="Image with Fill 40x100"/>
<Label Text="Image with Fill 40x100"
Style="{StaticResource Headline}"/>
<Image Source="dotnet_bot.png"
HeightRequest="40" WidthRequest="100"
Aspect="Fill"
/>

<Label Text="Online image"/>
<Label Text="Online image"
Style="{StaticResource Headline}"/>
<Image Source="https://aka.ms/campus.jpg"
WidthRequest="200"
HeightRequest="200"/>

<Label Text="Online image clipped"/>
<Label Text="Online image clipped"
Style="{StaticResource Headline}"/>
<Image Source="https://aka.ms/campus.jpg"
Aspect="AspectFill"
WidthRequest="100"
Expand All @@ -67,7 +74,14 @@
</Image.Clip>
</Image>

<Label Text="Image without sizing info"/>
<Label Text="Animated GIF"
Style="{StaticResource Headline}"/>
<Image Source="animated_heart.gif"
IsAnimationPlaying="True"
HorizontalOptions="Start" />

<Label Text="Image without sizing info"
Style="{StaticResource Headline}"/>
<Image Source="dotnet_bot.png" HorizontalOptions="Start" />
</VerticalStackLayout>
</ScrollView>
Expand Down
2 changes: 1 addition & 1 deletion src/ControlGallery/Pages/Controls/PickerPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<ScrollView>
<StackLayout Padding="{OnPlatform iOS='30,60,30,30', Android='15', Default='30'}">
<Picker Title="Select a color" ItemsSource="{Binding ColorNames}" SelectedItem="{Binding SelectedColorName, Mode=TwoWay}" />
<Picker Title="{OnPlatform 'Select a color', MacCatalyst=''}" ItemsSource="{Binding ColorNames}" SelectedItem="{Binding SelectedColorName, Mode=TwoWay}" />
<BoxView Color="{Binding SelectedColor}" HeightRequest="200" />
</StackLayout>
</ScrollView>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6f14c39

Please sign in to comment.