bootstrap in webview RRS feed

  • Question

  • User350253 posted

    Hi All,

    In my App, I'm displaying a report in WebView. It is a local HTML. Currently working fine but the report does not look nice with just HTML. I want to include bootstrap to this local HTML. I can do that by including the Bootstrap CDN link but most of the users do not have the internet on their phone.

    Is there a way to include the Bootstrap min file as a local asset and use it? Does anyone like to share a sample code?

    Friday, November 8, 2019 12:10 AM


  • User382871 posted

    Have yor tried using CSS to achieve the feature? WebView can display content from HTML, CSS and Javascript embedded within the Xamarin.Forms app. To dealwith pages that reference local resources, you need to use DependencyService to tell the WebView where to find files on the filesystem.

    For more details, check the Tutorial: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/webview?tabs=windows

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, November 8, 2019 12:32 PM