Pixiview/Pixiview.iOS/Renderers/CircleImageRenderer.cs
Tsanie Lily 66f0c1ba1b * Pixiview/UI/CircleUIs.cs:
* Pixiview.iOS/Pixiview.iOS.csproj:
* Pixiview.iOS/Renderers/RoundLabelRenderer.cs:
* Pixiview.iOS/Renderers/CircleImageRenderer.cs: custom round corner
  controls

* Pixiview/App.xaml:
* Pixiview/Utils/Converters.cs:
* Pixiview/GlobalSuppressions.cs:
* Pixiview/UI/StyleDefinition.cs:

* Pixiview/UI/AdaptedPage.cs:
* Pixiview.iOS/Renderers/AdaptedPageRenderer.cs: observe orientation

* Pixiview/MainPage.xaml:
* Pixiview/Utils/Stores.cs:
* Pixiview/MainPage.xaml.cs:
* Pixiview/Utils/IllustData.cs: data and UI adjust
2020-05-05 01:53:33 +08:00

32 lines
781 B
C#

using Pixiview.iOS.Renderers;
using Pixiview.UI;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(CircleImage), typeof(CircleImageRenderer))]
namespace Pixiview.iOS.Renderers
{
public class CircleImageRenderer : ImageRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Image> e)
{
base.OnElementChanged(e);
if (Control != null)
{
Control.Layer.MasksToBounds = true;
}
}
public override void LayoutSubviews()
{
base.LayoutSubviews();
if (Control != null)
{
Control.Layer.CornerRadius = Control.Frame.Size.Width / 2;
}
}
}
}