0

I added a WebView control to my .NET MAUI application and this control shall only be visible under certain conditions, e.g. the user wants to open a link.

My problem is that the WebView is always visible. What I have done in XAML is:

<WebView Source="{Binding Path=BrowserSource}"
         IsVisible="{Binding Path=ShowBrowser}" 
         ZIndex="1000" />

The BrowserSource is the link to the website that shall be shown, and ShowBrowser is a Boolean property stating whether the WebView shall be visible or not. The BrowserSource property works as I can set the URL, but ShowBrowser seems to be ignored.

I tried setting the IsVisible property of the control to Collapse, Hidden, or False in XAML directly without using any binding, but it is always visible.

How do I properly toggle the visibility for my WebView control? My visibility settings for any other control seems to work just fine.

I am testing my code on a current physical iPhone device (iOS 18.5).

6
  • Is your problem only reproducible on an iPhone iOS 18.5 device? Commented Sep 16 at 10:30
  • This is a progression. There was some weird jumping around the screen on Android last time I checked this. Quick question, are you trying to cover it behind a white rectangle with this Z index? Commented Sep 16 at 22:53
  • @H.A.H., No, I want to show it in front of everything if it is visible, but only if it is visible. My problem is that it is always visible. Commented Sep 17 at 15:10
  • @BeRo what if you set BOTH IsVisible="False" and ZIndex=0? Commented Sep 18 at 4:39
  • @BeRo I mean, performance issues aside, how about MainGrid with Z index = 2, WhiteRectangle with Z index = 1, and WebView with Z index switching between 0 and 3? Commented Sep 24 at 6:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.