This commit is contained in:
Stephane Delcroix 2018-11-19 09:04:08 +01:00
Родитель 157bc72fe8 3e006edb1a
Коммит fdfa582059
3 изменённых файлов: 58 добавлений и 36 удалений

Просмотреть файл

@ -192,8 +192,10 @@
<file src="..\Xamarin.Forms.Platform.MacOS\bin\$Configuration$\Xamarin.Forms.Platform.dll" target="lib\Xamarin.Mac" />
<file src="..\Xamarin.Forms.Core\bin\$Configuration$\netstandard2.0\Xamarin.Forms.Core.dll" target="lib\uap10.0" />
<file src="..\Xamarin.Forms.Core\bin\$Configuration$\netstandard2.0\Xamarin.Forms.Core.*pdb" target="lib\uap10.0" />
<file src="..\docs\Xamarin.Forms.Core.xml" target="lib\uap10.0" />
<file src="..\Xamarin.Forms.Xaml\bin\$Configuration$\netstandard2.0\Xamarin.Forms.Xaml.dll" target="lib\uap10.0" />
<file src="..\Xamarin.Forms.Xaml\bin\$Configuration$\netstandard2.0\Xamarin.Forms.Xaml.*pdb" target="lib\uap10.0" />
<file src="..\docs\Xamarin.Forms.Xaml.xml" target="lib\uap10.0" />
<!-- iOS Localized String Resource Assemblies -->

Просмотреть файл

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
@ -8,16 +9,16 @@ namespace Xamarin.Forms.Controls
{
public class ImageGallery : ContentPage
{
public ImageGallery ()
public ImageGallery()
{
Padding = new Thickness (20);
Padding = new Thickness(20);
var normal = new Image { Source = ImageSource.FromFile ("cover1.jpg") };
var disabled = new Image { Source = ImageSource.FromFile ("cover1.jpg") };
var rotate = new Image { Source = ImageSource.FromFile ("cover1.jpg") };
var transparent = new Image { Source = ImageSource.FromFile ("cover1.jpg") };
var embedded = new Image { Source = ImageSource.FromResource ("Xamarin.Forms.Controls.ControlGalleryPages.crimson.jpg", typeof (ImageGallery)) };
var normal = new Image { Source = ImageSource.FromFile("cover1.jpg") };
var disabled = new Image { Source = ImageSource.FromFile("cover1.jpg") };
var rotate = new Image { Source = ImageSource.FromFile("cover1.jpg") };
var transparent = new Image { Source = ImageSource.FromFile("cover1.jpg") };
var embedded = new Image { Source = ImageSource.FromResource("Xamarin.Forms.Controls.GalleryPages.crimson.jpg", typeof(ImageGallery).GetTypeInfo().Assembly) };
// let the stack shrink the images
normal.MinimumHeightRequest = normal.MinimumHeightRequest = 10;
@ -27,45 +28,63 @@ namespace Xamarin.Forms.Controls
embedded.MinimumHeightRequest = 10;
disabled.IsEnabled = false;
rotate.GestureRecognizers.Add (new TapGestureRecognizer { Command = new Command (o => rotate.RelRotateTo (180))});
rotate.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(o => rotate.RelRotateTo(180)) });
transparent.Opacity = .5;
Content = new StackLayout {
Orientation = StackOrientation.Horizontal,
Children = {
new StackLayout {
//MinimumWidthRequest = 20,
HorizontalOptions = LayoutOptions.FillAndExpand,
Children = {
normal,
disabled,
transparent,
rotate,
embedded,
new StackLayout {
HeightRequest = 30,
Orientation = StackOrientation.Horizontal,
Children = {
Content =
new ScrollView()
{
Content = new StackLayout
{
Orientation = StackOrientation.Horizontal,
Children =
{
new StackLayout
{
//MinimumWidthRequest = 20,
HorizontalOptions = LayoutOptions.FillAndExpand,
Children =
{
new Label(){ Text = "Normal"},
normal,
new Label(){ Text = "Disabled"},
disabled,
new Label(){ Text = "Transparent"},
transparent,
new Label(){ Text = "Rotate"},
rotate,
new Label(){ Text = "Embedded"},
embedded,
new Label(){ Text = "Horizontal"},
new StackLayout
{
HeightRequest = 30,
Orientation = StackOrientation.Horizontal,
Children =
{
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"}
}
}
}
},
new StackLayout
{
WidthRequest = 30,
Children =
{
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"}
}
}
}
},
new StackLayout {
WidthRequest = 30,
Children = {
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"},
new Image {Source = "cover1.jpg"}
}
}
}
};
};
}
}
}

Просмотреть файл

@ -80,6 +80,7 @@ namespace Xamarin.Forms.Platform.Android
bitmap?.Dispose();
imageController?.SetIsLoading(false);
imageController?.NativeSizeChanged();
}
}
}