* 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
This commit is contained in:
31
Pixiview.iOS/Renderers/CircleImageRenderer.cs
Normal file
31
Pixiview.iOS/Renderers/CircleImageRenderer.cs
Normal file
@ -0,0 +1,31 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user