How to create top corner radius in maui?

mc 5,511 Reputation points
2023-04-04T00:44:31.0033333+00:00

set a top-left-corner-radius and a top-right-corner-ridus?

Developer technologies | .NET | .NET MAUI
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 50,126 Reputation points Microsoft External Staff
    2023-04-04T02:08:27.2033333+00:00

    Hello,

    If you want to implement this effect in MAUI, you need to wrap it with Border, please refer to the following documents and examples:

    <Border Stroke="#C49B33"
            StrokeThickness="4"
            Background="#2B0B98"
            Padding="16,8"
            HorizontalOptions="Center">
        <Border.StrokeShape>
            <RoundRectangle CornerRadius="10,10,0,0" /> // Use this setting to set the radius in the upper-left and upper-right corners
        </Border.StrokeShape>
        <Label Text=".NET MAUI"
               TextColor="Red"
               FontSize="18"
               FontAttributes="Bold" />
    </Border>
    

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.