Skip to content

Rounded Corner Effect

The Rounded Corner Effect allows you to round the corners of a view and adjust the degrees as necessary.

View with Rounded Corner Effect

Rounded

View without Rounded Corner Effect

NotRounded

Methods

public static void SetCornerRadius(BindableObject view, double value)

Sets the corner radius.

view: View to apply effect to.

value: Amount of rounding to apply.

public static void SetBorderSize(BindableObject view, double value)

Sets the border size.

view: View to apply effect to.

value: Amount of border size to apply.

public static void SetBorderColor(BindableObject view, Color value)

Sets the border color.

view: View to apply effect to.

value: Border color to apply.

Example Usage

// Add the rounded corner effect to the view
view.Effects.Add(Effect.Resolve(RoundedCornersEffect.EffectName));

// Set the corner radius
RoundedCornersEffect.SetCornerRadius(view, 20);