ui adjustment

This commit is contained in:
2020-05-05 12:13:50 +08:00
parent 0ce7757ec4
commit fdf4c128af
18 changed files with 583 additions and 84 deletions

View File

@@ -13,14 +13,22 @@ namespace Pixiview.iOS.Renderers
{
base.OnElementChanged(e);
if (Control != null && Element is RoundLabel label)
var layer = Layer;
if (layer != null && e.NewElement is RoundLabel label)
{
int radius = label.CornerRadius;
var radius = label.CornerRadius;
if (radius > 0)
{
Control.Layer.CornerRadius = radius;
Control.BackgroundColor = label.BackgroundColor.ToUIColor();
Control.Layer.MasksToBounds = true;
layer.CornerRadius = radius;
//layer.MasksToBounds = true;
}
else
{
layer.CornerRadius = 0;
}
if (layer.BackgroundColor != default)
{
layer.BackgroundColor = label.BackgroundColor.ToCGColor();
}
}
}
@@ -31,14 +39,15 @@ namespace Pixiview.iOS.Renderers
if (e.PropertyName == RoundLabel.CornerRadiusProperty.PropertyName)
{
if (Control != null && Element is RoundLabel label)
var layer = Layer;
if (layer != null && Element is RoundLabel label)
{
int radius = label.CornerRadius;
var radius = label.CornerRadius;
if (radius > 0)
{
Control.Layer.CornerRadius = radius;
Control.BackgroundColor = label.BackgroundColor.ToUIColor();
Control.Layer.MasksToBounds = true;
layer.CornerRadius = radius;
layer.BackgroundColor = label.BackgroundColor.ToCGColor();
//layer.MasksToBounds = true;
}
}
}