Bug 32560 - Unable to toggle WebView visibility when it is initially set to false
Summary: Unable to toggle WebView visibility when it is initially set to false
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 1.4.4
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-07-29 06:38 UTC by Adam Hartley [MSFT]
Modified: 2015-08-03 06:40 UTC (History)
6 users (show)

Tags: AC iOS webview
Is this bug a regression?: ---
Last known good build:

Sample (6.98 MB, application/zip)
2015-07-29 06:45 UTC, Adam Hartley [MSFT]
Updated Sample with (6.94 MB, application/octet-stream)
2015-07-29 17:46 UTC, Rui Marinho
Video of bug (1.04 MB, video/quicktime)
2015-07-30 02:42 UTC, David Redmond
Video Sample working Xamarin.com (3.13 MB, video/quicktime)
2015-07-30 11:26 UTC, Rui Marinho
Sample test using HtmlWebViewSource (1.19 MB, video/quicktime)
2015-08-03 06:40 UTC, David Redmond

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Adam Hartley [MSFT] 2015-07-29 06:38:28 UTC
## Overview

When initially the visibility is set to false on a WebView, toggling it's visibility does not make it visible.

## Steps to reproduce

1. Run attached sample on the iOS simulator
2. Tap the button to toggle the visibility of the WebView

## Expected result

WebView becomes visible

## Actual result

WebView remains invisible

## Notes

When breaking at the point of toggling the visibility, you can see that the IsVisible property is being set to true.

Setting IsVisible on line 16 of App.cs to true, rather than false, enables the visibility to be toggled as expected.

Works as expected on Android
Comment 1 Adam Hartley [MSFT] 2015-07-29 06:45:18 UTC
Created attachment 12268 [details]
Comment 2 Rui Marinho 2015-07-29 17:45:14 UTC
Hi Adam, seems you aren't using the latest version on the iOS project, i have updated all projects for and everything works ok. I attached the updated sample.

Please reopen if it's still a issue.
Comment 3 Rui Marinho 2015-07-29 17:46:26 UTC
Created attachment 12291 [details]
Updated Sample with
Comment 4 David Redmond 2015-07-30 02:42:34 UTC
Created attachment 12293 [details]
Video of bug

Bug still exists using latest attached solution.  All Xamarin packages updated to latest versions.  Tested using Xamarin Studio & Visual Studio 2015.
Comment 5 Rui Marinho 2015-07-30 11:23:41 UTC
Hey @David did you tested on device? 

Make sure to clean solution and reset the simulator.

try changing the page Source = "http://www.xamarin.com"
Comment 6 Rui Marinho 2015-07-30 11:26:36 UTC
Created attachment 12297 [details]
Video Sample working Xamarin.com
Comment 7 David Redmond 2015-08-03 06:40:08 UTC
Hi Rui,

It worked when using xamarin.com as the source.  I changed my source to a HtmlWebViewSource and the problem appears again.  Simple code change is;

            var webView = new WebView()
                IsVisible = false,
                Source = new HtmlWebViewSource() {
                    Html = "<html><body>Testing!</body></html>"
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand

I've attached a QT video of the behaviour.  Clean solution & iPhone SImulator has been reset.  I have not tested on a real device.

Comment 8 David Redmond 2015-08-03 06:40:47 UTC
Created attachment 12335 [details]
Sample test using HtmlWebViewSource