When i bind data to the listView and then run the application it show be error .
Xamarin.Forms.Xaml.XamlParseException: Position 10:14. Type StacKLayout not found in xmlns http://xamarin.com/schemas/2014/forms
below is my Code
public static ObservableCollection ProductList = new ObservableCollection() {
new ProductModel {ID=1, Name="Mobile", UnitCost=19.50m },
new ProductModel {ID=2, Name="Deskyop Computer", UnitCost=19.50m }
};
<ContentPage.Content> <ListView x:Name="ListProduct" RowHeight="60"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <StacKLayout Orientation="Horizontal" Padding="5"> <Label Text="{Binding Name}" /> <Label Text="{Binding UnitCost}" TextColor="Green" FontSize="Small"/> </StacKLayout> </ViewCell> </DataTemplate> </ListView.ItemTemplate> </ListView>
</ContentPage.Content>
Answers
StacKLayout does not exist
StackLayout exists
but stacklayout is there in my code
In XAML you have write K instead of k
check my Xml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage.Content>
<ListView.ItemTemplate>
Ok now it's correct