-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove popup shadow on iOS 17 #1615
Conversation
Please check if this solution still works when showing multiple (or just 2) popups one after another. |
@Toine-db , Isn't what looks like a shadow the Margin of the Popup's Content? |
Im not sure what you mean, are you talking about the second popup or the first? I noticed that when there was a short delay between the popups, the backgrounds were removed properly. |
@Toine-db , Something like the video below. iPhone.15.iOS.17.0.2024-01-05.08-46-02.mp4I mentioned that after displaying the second popup, the margin part of the previous popup appears like a shadow. |
This looks indeed like the issue I encountered, so this isn't the shadow we first removed? |
@Toine-db , This is not the shadow we removed earlier. Even in the code you wrote, this shadow-like area should appear by specifying the Margin for the Popup's content. |
@cat0363 It took a while but I finally see what you are trying to say. so if I understand correctly it happens because there is another popup (or a remnant of one) on the screen and the OS automatically (unintentionally) takes this into account with its built-in overlay. I think this falls outside this issue, but since we are talking about it now, do you have a proposal on how to tackle this? perhaps options such as:
|
@Toine-db , As you understand, at least the problem of erasing the original shadow has been resolved. I tried various solutions, but none of them could make the part that looks like a shadow transparent. |
The shadow-like problem seemed to be resolved, but it was because I made the overlay View transparent. |
As I mentioned earlier, the part that looks like a shadow is due to the self-made overlay added in #1369. First, delete your homemade overlay. [src\CommunityToolkit.Maui.Core\Views\Popup\MauiPopup.macios.cs]
I added a self-made overlay in #1369 because I didn't think there was an overlay provided by the OS. The overlay provided by the OS existed under the class name "_UIPopoverDimmingView" when searching the hierarchy below ContainerView of PresentationController. This is the overlay provided by the OS. You need to reset the transparency of this overlay. Next, I added the code below to erase the shadow of the Popup provided by the OS, but I will make this part general. [src\CommunityToolkit.Maui.Core\Views\Popup\MauiPopup.macios.cs]
The Popup shadow added by the OS exists with the class name "_UICutoutShadowView" when you search the hierarchy below ContainerView of PresentationController. This is the first shadow I removed in this PR. Based on the above, here's what we should do.
Add the SetShadowView method to remove the shadow added by the OS and change the transparency of the overlay. Below is the verification video. iPhone.13.iOS.15.5.2024-01-19.09-46-39.mp4The shadow that was displayed on the Popup disappears, and the overlay gets darker as you add more Popups, so you can see that it is displayed as intended. |
@cat0363 you have been busy, great job finding the issue. I wasn't able to find time to help you with this issue, sorry for that. Your solution looks promising, hopefully it will be released soon. |
@Toine-db , Thank you for your reply. |
thank you for your investigation |
Hi Guys, |
Hi guys, when it will be ready? Many thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cat0363! Apologies this took so long to merge.
This PR resolves the issue where Popup shadows are displayed on iOS 17.
Description of Change
In iOS 17, the hierarchy in which Popup shadows are drawn has changed.
The solution in PR #1463 doesn't work on iOS 17, so I modified it as follows:
[src\CommunityToolkit.Maui.Core\Views\Popup\MauiPopup.macios.cs]
The hierarchy in which the shadow is drawn changes depending on whether the Popup color is transparent or not, so we will divide the cases as shown above.
Linked Issues
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRAdditional information
Below are the verification results.
If Popup's Color is transparent
If Popup Color is not transparent
You can see that the Popup's shadow has been removed.
If the popup color is not transparent, I changed the popup color to white and the grid margin to 0 to test it.