Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Creating a ViewRenderer (Custom view) programatically

$
0
0

I have a ViewRenderer implemented and I want to create from an (Android) platform an instance of this ViewRenderer (Let's call it HybridWebview) from code.

So far, all easy
hybridWebview = new ProjectPCL.HybridWebview ();

The object is created but the native "OnElementChangedOnElementChanged" is never fired, I guess because I do not add it to a form.

I can not add it to a form/activity because I do not have it, I want to create it in a service: It is a webview and I need to process Javascript.

This works without problems, I already have applications that do it, what I had never tried is that Webview was a ViewRenderer.

So the question is: How can I force that view to be created and therefore rendered without having a form?

Thank you.


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>