The problem with the WebView content not responding to any clicks, scrolls, etc appears to have been caused by an unused CollectionView in the source.
I had this
<Grid Margin="0"
Padding="{StaticResource SpacingDefaultTop}"
BackgroundColor="{StaticResource SecondaryColor}"
IsVisible="{Binding TrustPayFrameVisible}">
<WebView x:Name="PaymentWebView"
Scale="1"
Source="{Binding WebViewContent}" />
<CollectionView x:Name="ItemsCollectionView" ItemsSource="{Binding Items}">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="api:UserCard">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="6*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label Grid.Column="0"
FontSize="{StaticResource Body1FontSize}"
LineBreakMode="TailTruncation"
Text="{Binding CardType}" />
<Label Grid.Column="1"
FontSize="{StaticResource Body1FontSize}"
LineBreakMode="TailTruncation"
Text="{Binding CardLastFourDigits}" />
<Label Grid.Column="2"
FontAttributes="Bold"
FontSize="{StaticResource Body1FontSize}"
HorizontalTextAlignment="End">
<Label.FormattedText>
<FormattedString>
<Span Text="{Binding ExpiryMonth}" />
<Span Text="/" />
<Span Text="{Binding ExpiryYear}" />
</FormattedString>
</Label.FormattedText>
</Label>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
The CollectionView is no longer required, but I just hadn't removed it. When I did, the standard WebView then worked correctly.
<Grid Margin="0"
Padding="{StaticResource SpacingDefaultTop}"
BackgroundColor="{StaticResource SecondaryColor}"
IsVisible="{Binding TrustPayFrameVisible}">
<WebView x:Name="PaymentWebView"
Scale="1"
Source="{Binding WebViewContent}" />
</Grid>
Yes, it is a custom
WebViewClient
You use a website( Does it work normally in the Android Chrome application?) and have noticed that nothing works, do you create custom renderer for webview to enable above settings?
OK, so the problem of "no links work" etc when the WebView displays the page ... was caused by me having an unused CollectionView beneath the WebView, in the same Grid element!
I commented out the CollectionView (isn't needed now) and now the web page works, in a standard WebView!! There are now other issues, but that's hopefully something I can now sort out.
OK, In this thread, we are mainly discussing about this issues indicated by the first post. And it is solved. it will encourge the person who help you. Then for your new question it would be best if you try to open up a new thread for it. In this way, it will make answer searching in the forum easier and be beneficial to other community members as well.
The actual resolution appears to be me removing some unwanted markup (CollectionView) - I'm not sure the only answer I can "Accept" had anything to do with that.
The response was useful in part, but not the solution - so what should I do? Post my own "Answer" and accept that? Leave it without accepting an answer? Remove the thread entirely? (Sorry, a bit new to this)
Post your own "Answer" and accept that, it is a good choose.
Hi,
Where we need to do this
I am getting error on web_view.
Sign in to comment