* 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
32 lines
781 B
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|