I have consume rest service from xamarin form.But my listview not shown that.It shown lots of empty rows only.
Rest Service Response
[ { "prodName":"abc", "qty":142.0, "price":110.0 }, { "prodName":"efg", "qty":20.0, "price":900.0 } ] My .xaml file
<ListView x:Name="ProductsListView"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <StackLayout Orientation="Horizontal"> <Label Text="{Binding prodName}" TextColor="Black"></Label> <Label Text="{Binding price}" TextColor="Black"></Label> </StackLayout> </ViewCell> </DataTemplate> </ListView.ItemTemplate> </ListView> xaml.cs file
private async void GetProducts() { HttpClient client = new HttpClient(); var response = await client.GetStringAsync("http://myUrl/Api/Values"); var products = response; ProductsListView.ItemsSource = products; }