Maui: [BUG] Popup cannot be display with right angles or rounded angles
Is there an existing issue for this?
- I have searched the existing issues
Did you read the “Reporting a bug” section on Contributing file?
- I have read the “Reporting a bug” section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
Current Behavior
When displaying a CommunityToolkit.Maui.Views.Popup, I would like to be able to define the angles radius.
At this moment, it is follow the native default value, that is right angles on Android and rounded angles on iOS for instance.
On Android :
On iOS :
Expected Behavior
I would like to have a parameter setting the corner radius.
Or the best would be to draw ourself the view, maybe with a handler and cgrect for iOS for instance ? Any advice or help would be appreciated on this point if it is possible.
I have had a look at the code, and maybe here we could do something for iOS to draw the frame using a CGRect ? https://github.com/CommunityToolkit/Maui/blob/3b44cc0350d57b196a967d2faa917d7cf23e27fa/src/CommunityToolkit.Maui.Core/Views/Popup/MauiPopup.macios.cs#L142C18-L142C18
OR if it is doing using a handler I would be happy to learn
Steps To Reproduce
- Get the sample project https://github.com/espritm/Maui.Toolkit.Popup
- Build and run, click the button, the popup is displayed
- In Controls folder, Popup class, I would like to have a parameter or some native code pour modifiy the angles.
Link to public reproduction project repository
https://github.com/espritm/Maui.Toolkit.Popup
Environment
- .NET MAUI CommunityToolkit:6.0.0
- OS:iOS, Android
- .NET MAUI:7.0
Anything else?
No response
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Reactions: 1
- Comments: 18 (10 by maintainers)
@cat0363 @espritm try this, may be iOS`s Default Shadow view for popup
I am using this to remove the Shadow since wantsDefaultContentAppearance was Deprecated, and can`t found other workarounds.
It also can fix ↑.
If you want to customize it with a handler, please also add the following.
The above prevents the popup corner curvature from changing after screen rotation.
Due to the time difference, I created the PR in advance.
It seems that it is not enough to simply set it to 40.0f.
@maonaoda , I tested it with the layout below.
Below is the verification result after changing the StokeShape and adjusting the roundness of the corners.