Emil
Emil

Reputation: 6891

webview inside listview on xamarin.forms

enter image description here

I try to read an rss feed and display on the webview and listview. When I run my code into the Xamarin Android emulator, it is displaying as below. Display looks corrupted?

  1. I dont know where are these triangles coming from on the right side?
  2. [Click here][2] for the rss feed url. I am reading the description element of each item and displaying them in the vebview. As you can see each description is pretty long but it is display only part of the description until the straight line for each. Why is it truncation?

    ListView.ItemTemplate>

         </StackLayout>               
    
      </ViewCell>
    </DataTemplate>
    

and the convertor

 public class HtmlSourceConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        var html = new HtmlWebViewSource();

        if (value != null)
        {
            html.Html = value.ToString();
        }

        return html;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}

Upvotes: 1

Views: 1579

Answers (1)

Yksh
Yksh

Reputation: 3306

It's generally just a bad idea to even try to nest a web view inside a list view. Even a nested scroll views can cause UX problems. I would recommend using a different kind of view for your cells.

I think the good way to do it is to just try to grab the content and throw it in a label.

I had seen a similar type of quest in Xamarin Forums : webview inside a listview

Upvotes: 2

Related Questions