Popup: new OverlayColor property. #1799
Replies: 4 comments 6 replies
-
I learned how to do it (at least for Android). If anyone needs to do this aswell, I created a custom handler so it would remove the "Overlay", which I now know is actually called Dim.
This has completely removed any Dim from any popups for all Android versions. |
Beta Was this translation helpful? Give feedback.
-
I am surprised this wasn't done when the control was created. I am trying to change the background color of the overlay for popups on Windows at the moment because it based it on the Windows theme color? I think. So I have a popup that has a white background (due to company branding) and now it clashes with the overlay. Any workarounds for Windows? I have tried forcing the the app to dark mode but seems to make no difference. |
Beta Was this translation helpful? Give feedback.
-
not sure if this is being looked at @bijington can advise. |
Beta Was this translation helpful? Give feedback.
-
You can take full control of the screen with:
Then, you can control/tinge the color of the entire screen and size your content at the center of the screen: <toolkit:Popup HorizontalOptions="Fill" VerticalOptions="Fill" Color="Transparent">
<Grid>
<BoxView x:Name="tinge" BackgroundColor="SkyBlue" Opacity="0.1" />
<Grid Width="200" Height="200">
<!-- Your content here -->
</Grid>
</Grid>
</toolkit:Popup> |
Beta Was this translation helpful? Give feedback.
-
As per this discussion #824, that was closed a long time ago, I see value in being able to change the color of the shown overlay when a Popup appears. Here an example of the "overlay":
No popup:
![image](https://private-user-images.githubusercontent.com/103965702/320063506-de942df4-05da-40aa-8b9c-f3519e28a3c7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NjE2NTcsIm5iZiI6MTczOTU2MTM1NywicGF0aCI6Ii8xMDM5NjU3MDIvMzIwMDYzNTA2LWRlOTQyZGY0LTA1ZGEtNDBhYS04YjljLWYzNTE5ZTI4YTNjNy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNFQxOTI5MTdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02ZTZlZGFjZDQ1MGYzNjg5MTBkNGQyNDdmN2UxYjk2YThjMmYxYTFmNDc3M2Q3Njk3M2VkNDc2NmU4N2ZlZjM0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.xyFLeB1P1pxBmwLwy0xEF1KQvPArQL6CGKzNBnyD3SQ)
Popup shown:
![image](https://private-user-images.githubusercontent.com/103965702/320063440-02682ff8-1b48-40b3-9acc-9d71d3dfd9b2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NjE2NTcsIm5iZiI6MTczOTU2MTM1NywicGF0aCI6Ii8xMDM5NjU3MDIvMzIwMDYzNDQwLTAyNjgyZmY4LTFiNDgtNDBiMy05YWNjLTlkNzFkM2RmZDliMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNFQxOTI5MTdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00YWZhZDNmNzFiODUzNmFmMTFjMGFmNjNjNGQwYzM5YjZmY2E5M2UxMmY1OTQxOTdjYjRmMjBmZDAyNjAzYzIyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.-T0RpccCqgaSCmj2ceqP1w6s-LOAAMLNPEDKGwKHgJ4)
What I mean by "overlay" is the white tinge that appears all over the screen.
The reason why I'd want this feature is that I'd been trying to create a "Context menu" for a MAUI mobile focused App, that opens up when I click a button. As shown here, when I click the 3 dotted button:
The best native implementation I've found for this is to create a Popup with a transparent color property (I'm not allowed to create Hybrid implementations for this particular project). For some reason this works like I want when testing in Android API 34 Platform Version, but when I test in API 31 or lower versions (haven't tried exactly all versions) it does create the "overlay tinge". As shown here:
Because of this I've had to try other implementations that don't use the CommunityToolkit.Maui Popup object, which is what I'd prefer to use.
As a side note if anyone knows of a good way to implement the controler I've described, I'd appreciate tips on that. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions