androidxamarin.androidandroid-webviewmvvmcross

webview implementation using MvvmCross android native XAMARIN


We are using mvvmcross for Xamarin android native but unable to use webview to render html page, please help if anyone tried ...regular xamarin android can do but since we use mvvmcross then that regular won't work

We tried using mvvmcross XAMRIN also added plugin https://nuget.info/packages/MvvmCross.Plugin.WebBrowser/8.0.2 but nothing works


Solution

  • I Did it from View because below LoadDataWithBaseURL() function is not supported/working in ViewModel i have added below code in View.

    WebView.LoadDataWithBaseURL(null, Html, "text/html", "utf-8", null); 
    

    In design

    <WebView android:id="@+id/ReceiptWebView" android:layout_width="match_parent" android:layout_height="match_parent"/>
    

    It will load HTMl with Table.