Hi there guys, a newbie on Xamarin Forms here.
I´ll try to explain my best, I prepared some images to clarify this doubt.
I have an app where you have a list to choose items (products), by clicking on an item takes you to the next list (brands), again a click takes you to the different elements of that product and brand, to end in a description of the chosen product.
It reads an XLS Excel file to get the info with NPOI.
and all this works perfectly for the elements that fit on the screen at that moment
but if I scroll to get ( Itemtapped) items on the list that are offset the screen (scrolling to reach them), a very curious thing happens, the last option to choose the specific item does not appear, the list is blank, but the "buttons" are there, so if I click on an empty button, it takes me to the correct description
I mean, the code internally works correctly, but the text is not showed on the screen (sometimes it show something, others none, is a very random issue, but always happens for the items offset screen).
Details: if I change in the excel database the position of the sheets, so for example, the items that were previously under, are now up, it works nicely, but now, again, the items that left offscreen are the issue ones XD, is very curious, because the code works, is not a fault on some "extrange format" in the excel sheets. Before posting here I tried every crazy thing I thought of it.
Are there any know issue with ListView and Itemtapped related (on a StackLayout), with items offset the screen?
This is my XAML code.
<?xml version="1.0" encoding="utf-8" ?>
<StackLayout >
<!-- Place new controls here -->
<StackLayout >
<Button Text="PRESUP DE ENMAR"
Clicked="OnButtonMarcos"
HeightRequest="35"
FontSize="12"
TextColor="White"
BackgroundColor= "#8e8e8e"
BorderRadius="15"
BorderColor="Black"
BorderWidth="2" />
</StackLayout>
<Grid>
<Grid.ColumnDefinitions >
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackLayout Grid.Column="0" >
<Button Text="RESET"
Clicked="OnButtonReset"
HeightRequest="35"
FontSize="12"
TextColor="White"
BackgroundColor= "#5e5e5e"
BorderRadius="15"
BorderColor="Black"
BorderWidth="2"/>
</StackLayout>
<StackLayout Grid.Column="1">
<Button Text="MIS DATOS"
Clicked="OnButtonMisDatos"
HeightRequest="35"
FontSize="12"
TextColor="White"
BackgroundColor= "#5e5e5e"
BorderRadius="15"
BorderColor="Black"
BorderWidth="2"/>
</StackLayout>
</Grid>
<StackLayout Padding="0,10,0,10">
<BoxView HeightRequest="5" BackgroundColor="Accent" />
</StackLayout>
<ListView HasUnevenRows="True" x:Name="myListView">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout VerticalOptions="Center" HorizontalOptions="Center" Grid.Column="0">
<Label FontSize="20" Text="{Binding Etiquetas}" TextColor="Black" HorizontalOptions="Center"/>
<StackLayout>
<BoxView HeightRequest="2" WidthRequest="500" BackgroundColor="Green"/>
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
Hope I explained well
Thanks guys!!!!