How to customize the CornerRadius in .NET MAUI EffectsView?
The .NET MAUI EffectsView control allows you to add touch effects to any view. Customizing the CornerRadius
of the EffectsView
can be achieved by embedding it within a Border control and setting the CornerRadius
property of the RoundRectangle
used in the Border.StrokeShape
.
Steps to Customize CornerRadius
- Initialize the Control: Wrap the
Syncfusion EffectsView
control within aBorder
control. - Set the StrokeShape: Define the
StrokeShape
property of theBorder
to aRoundRectangle
. - Define CornerRadius: Set the
CornerRadius
property of theRoundRectangle
to the desired value.
XAML
Below is an example demonstrating how to customize the CornerRadius
of an EffectsView
:
<Border HeightRequest="50"
WidthRequest="200">
<Border.StrokeShape>
<RoundRectangle CornerRadius="20"/>
</Border.StrokeShape>
<sfEffectsView:SfEffectsView TouchDownEffects="Ripple"
RippleBackground="Red">
<Label Text="Click Me"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"/>
</sfEffectsView:SfEffectsView>
</Border>
Output
Download the complete sample on GitHub
Conclusion
I hope you enjoyed learning how to customize the CornerRadius in .NET MAUI EffectsView (SfEffectsView).
You can refer to our .NET MAUI EffectsView Feature tour page to learn about its other groundbreaking feature representations. Explore our .NET MAUI EffectsView documentationto understand how to present and manipulate data.
For current customers, you can check out our .NET MAUI components from the License and documents page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our .NET MAUI EffectsView and other .NET MAUI components.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Track, or feedback portal. We are always happy to assist you!