Xamarin Froms Listview Not all items are shown












2















Hello fellow Xamarin victim,



I'm having an issue with my ListView, where not all items from the itemsource are shown. 6 of the in total 12 items are shown. Here you have my XAML Page where you can see how i use the listview (the listview is used in the middlepart):



<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Prototype_Deinceps.views.subject.DetailPage"
xmlns:multiplechoices="clr-namespace:Prototype_Deinceps.viewincludes.QuestionTypes;assembly=Prototype_Deinceps"
xmlns:CustomElements="clr-namespace:Prototype_Deinceps.CustomElements;assembly=Prototype_Deinceps"
Title="Detail">
<!-- ToolBar -->
<ContentPage.ToolbarItems>
<ToolbarItem Icon="Edit.png">
<ToolbarItem.Text>
<OnPlatform x:TypeArguments="x:String"
iOS="Wijzig"/>
</ToolbarItem.Text>
</ToolbarItem>
</ContentPage.ToolbarItems>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="6*" />
<RowDefinition Height= "9*" />
<RowDefinition Height="6*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<!-- Top part of the screen that consist of basic info of the entity-->
<StackLayout x:Name="BasicInfo" Margin="10,10,10,5" Grid.Row="0" Grid.Column="0">
<Label Text="Basic Info" FontSize="Large"/>
<BoxView Color="Black" WidthRequest ="100" HeightRequest="1"/>
<Label x:Name="text1" />
<Label x:Name="text2" />
<Label x:Name="text3" />
<Label x:Name="text4" />
</StackLayout>
<Image x:Name="EntityImage" Margin="10" Grid.Row="0" Grid.Column="1"/>
<!-- End of Top -->

<!-- Middle part of the screen where the questions are displayed about the entity-->
<StackLayout x:Name="Questions" Margin="5,10,10,0" Grid.Row="1" Grid.ColumnSpan="2">
<Label Text="Questions" FontSize="Large"/>
<BoxView Color="Black" WidthRequest ="100" HeightRequest="1"/>
<ScrollView>
<ListView x:Name="QuestionListView"
HasUnevenRows="True"
ItemTapped="OnItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout x:Name="ListItem" Orientation="Horizontal" >
<multiplechoices:MultipleChoice x:Name="multi" IsVisible="{Binding isMultipleChoice} "/>
<multiplechoices:TrueFalse IsVisible="{Binding isTrueFalse}"/>
<multiplechoices:Text IsVisible="{Binding isText}"/>
<multiplechoices:LineText IsVisible="{Binding isLineText}"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollView>
</StackLayout>
<!-- End of Middle -->

<!-- Bottem part of the screen where you can put a note of the entity and save your info-->
<StackLayout x:Name="Extra" Margin="0,10,30,5" Grid.Row="2" Grid.ColumnSpan="2">
<Label Text="Opmerkingen" FontSize="Large"/>
<BoxView Color="Black" WidthRequest ="100" HeightRequest="1"/>
<CustomElements:CustomEditor PlaceHolder="Schrijf hier een opmerking..."/>
<Button Text="Opslaan" HorizontalOptions="EndAndExpand" BackgroundColor="#AB001C" TextColor="White"/>
</StackLayout>
<!-- End of Bottom -->

</Grid>
</ContentPage>


Here you have te part where i define what my items are. In a writeline i can see that all 12 items are added to the itemsource. So i doubt the issue is in here, but for the sake of it here is the code behind:



 public partial class DetailPage : ContentPage
{

public Subject sb;
int i;
public DetailPage(Subject subject)
{
InitializeComponent();

sb = subject;
TapGestureRecognizer tap = new TapGestureRecognizer();
EntityImage.Source = ImageSource.FromFile("nobody_moriginal.jpg");
text1.Text = subject.text1;
text2.Text = subject.text2;
text3.Text = subject.text3;
text4.Text = subject.text4;

tap.Tapped += OnTap;
BasicInfo.GestureRecognizers.Add(tap);

QuestionListView.ItemsSource = new List<Question>
{
new Question
{
Vraag = "1+1=?",
TypeQuestion = Question.QuestionTypes.MulptipleChoice
},
new Question
{
Vraag= "Is dit waar?",
TypeQuestion = Question.QuestionTypes.TrueFalse
},
new Question
{
Vraag= "Hoe ziet jou leven eruit?",
TypeQuestion = Question.QuestionTypes.Text
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
}, new Question
{
Vraag= "Hoe ziet jou leven eruit?",
TypeQuestion = Question.QuestionTypes.Text
}, new Question
{
Vraag= "Hoe ziet jou leven eruit?",
TypeQuestion = Question.QuestionTypes.Text
}
};
}

private async void OnTap(object sender, EventArgs e)
{
await Navigation.PushAsync(new BasicInfoPage(sb));
}

private void OnItemTapped(object sender, ItemTappedEventArgs e)
{
if (e == null) return; // has been set to null, do not 'process' tapped event
((ListView)sender).SelectedItem = null; // de-select the row
}


Thank you in advance!










share|improve this question

























  • you did not need to use scrollview with listview, by default each list view have internal scrollview

    – Mike Darwish
    Feb 14 '17 at 11:17











  • As far as I remember, listview is scrollable by default. I would try another approach, with a Listview as a parent of all of them, and the grid bound inside it. Guessing, your grid is limiting the number of record you are showing.

    – Elias MP
    Feb 14 '17 at 11:28






  • 1





    @MikeDarwish You are right, and that also was the problem thanks for reminding me.

    – Diceble
    Feb 14 '17 at 12:46











  • you welcome , I add an answer :)

    – Mike Darwish
    Feb 14 '17 at 12:53
















2















Hello fellow Xamarin victim,



I'm having an issue with my ListView, where not all items from the itemsource are shown. 6 of the in total 12 items are shown. Here you have my XAML Page where you can see how i use the listview (the listview is used in the middlepart):



<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Prototype_Deinceps.views.subject.DetailPage"
xmlns:multiplechoices="clr-namespace:Prototype_Deinceps.viewincludes.QuestionTypes;assembly=Prototype_Deinceps"
xmlns:CustomElements="clr-namespace:Prototype_Deinceps.CustomElements;assembly=Prototype_Deinceps"
Title="Detail">
<!-- ToolBar -->
<ContentPage.ToolbarItems>
<ToolbarItem Icon="Edit.png">
<ToolbarItem.Text>
<OnPlatform x:TypeArguments="x:String"
iOS="Wijzig"/>
</ToolbarItem.Text>
</ToolbarItem>
</ContentPage.ToolbarItems>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="6*" />
<RowDefinition Height= "9*" />
<RowDefinition Height="6*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<!-- Top part of the screen that consist of basic info of the entity-->
<StackLayout x:Name="BasicInfo" Margin="10,10,10,5" Grid.Row="0" Grid.Column="0">
<Label Text="Basic Info" FontSize="Large"/>
<BoxView Color="Black" WidthRequest ="100" HeightRequest="1"/>
<Label x:Name="text1" />
<Label x:Name="text2" />
<Label x:Name="text3" />
<Label x:Name="text4" />
</StackLayout>
<Image x:Name="EntityImage" Margin="10" Grid.Row="0" Grid.Column="1"/>
<!-- End of Top -->

<!-- Middle part of the screen where the questions are displayed about the entity-->
<StackLayout x:Name="Questions" Margin="5,10,10,0" Grid.Row="1" Grid.ColumnSpan="2">
<Label Text="Questions" FontSize="Large"/>
<BoxView Color="Black" WidthRequest ="100" HeightRequest="1"/>
<ScrollView>
<ListView x:Name="QuestionListView"
HasUnevenRows="True"
ItemTapped="OnItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout x:Name="ListItem" Orientation="Horizontal" >
<multiplechoices:MultipleChoice x:Name="multi" IsVisible="{Binding isMultipleChoice} "/>
<multiplechoices:TrueFalse IsVisible="{Binding isTrueFalse}"/>
<multiplechoices:Text IsVisible="{Binding isText}"/>
<multiplechoices:LineText IsVisible="{Binding isLineText}"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollView>
</StackLayout>
<!-- End of Middle -->

<!-- Bottem part of the screen where you can put a note of the entity and save your info-->
<StackLayout x:Name="Extra" Margin="0,10,30,5" Grid.Row="2" Grid.ColumnSpan="2">
<Label Text="Opmerkingen" FontSize="Large"/>
<BoxView Color="Black" WidthRequest ="100" HeightRequest="1"/>
<CustomElements:CustomEditor PlaceHolder="Schrijf hier een opmerking..."/>
<Button Text="Opslaan" HorizontalOptions="EndAndExpand" BackgroundColor="#AB001C" TextColor="White"/>
</StackLayout>
<!-- End of Bottom -->

</Grid>
</ContentPage>


Here you have te part where i define what my items are. In a writeline i can see that all 12 items are added to the itemsource. So i doubt the issue is in here, but for the sake of it here is the code behind:



 public partial class DetailPage : ContentPage
{

public Subject sb;
int i;
public DetailPage(Subject subject)
{
InitializeComponent();

sb = subject;
TapGestureRecognizer tap = new TapGestureRecognizer();
EntityImage.Source = ImageSource.FromFile("nobody_moriginal.jpg");
text1.Text = subject.text1;
text2.Text = subject.text2;
text3.Text = subject.text3;
text4.Text = subject.text4;

tap.Tapped += OnTap;
BasicInfo.GestureRecognizers.Add(tap);

QuestionListView.ItemsSource = new List<Question>
{
new Question
{
Vraag = "1+1=?",
TypeQuestion = Question.QuestionTypes.MulptipleChoice
},
new Question
{
Vraag= "Is dit waar?",
TypeQuestion = Question.QuestionTypes.TrueFalse
},
new Question
{
Vraag= "Hoe ziet jou leven eruit?",
TypeQuestion = Question.QuestionTypes.Text
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
}, new Question
{
Vraag= "Hoe ziet jou leven eruit?",
TypeQuestion = Question.QuestionTypes.Text
}, new Question
{
Vraag= "Hoe ziet jou leven eruit?",
TypeQuestion = Question.QuestionTypes.Text
}
};
}

private async void OnTap(object sender, EventArgs e)
{
await Navigation.PushAsync(new BasicInfoPage(sb));
}

private void OnItemTapped(object sender, ItemTappedEventArgs e)
{
if (e == null) return; // has been set to null, do not 'process' tapped event
((ListView)sender).SelectedItem = null; // de-select the row
}


Thank you in advance!










share|improve this question

























  • you did not need to use scrollview with listview, by default each list view have internal scrollview

    – Mike Darwish
    Feb 14 '17 at 11:17











  • As far as I remember, listview is scrollable by default. I would try another approach, with a Listview as a parent of all of them, and the grid bound inside it. Guessing, your grid is limiting the number of record you are showing.

    – Elias MP
    Feb 14 '17 at 11:28






  • 1





    @MikeDarwish You are right, and that also was the problem thanks for reminding me.

    – Diceble
    Feb 14 '17 at 12:46











  • you welcome , I add an answer :)

    – Mike Darwish
    Feb 14 '17 at 12:53














2












2








2








Hello fellow Xamarin victim,



I'm having an issue with my ListView, where not all items from the itemsource are shown. 6 of the in total 12 items are shown. Here you have my XAML Page where you can see how i use the listview (the listview is used in the middlepart):



<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Prototype_Deinceps.views.subject.DetailPage"
xmlns:multiplechoices="clr-namespace:Prototype_Deinceps.viewincludes.QuestionTypes;assembly=Prototype_Deinceps"
xmlns:CustomElements="clr-namespace:Prototype_Deinceps.CustomElements;assembly=Prototype_Deinceps"
Title="Detail">
<!-- ToolBar -->
<ContentPage.ToolbarItems>
<ToolbarItem Icon="Edit.png">
<ToolbarItem.Text>
<OnPlatform x:TypeArguments="x:String"
iOS="Wijzig"/>
</ToolbarItem.Text>
</ToolbarItem>
</ContentPage.ToolbarItems>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="6*" />
<RowDefinition Height= "9*" />
<RowDefinition Height="6*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<!-- Top part of the screen that consist of basic info of the entity-->
<StackLayout x:Name="BasicInfo" Margin="10,10,10,5" Grid.Row="0" Grid.Column="0">
<Label Text="Basic Info" FontSize="Large"/>
<BoxView Color="Black" WidthRequest ="100" HeightRequest="1"/>
<Label x:Name="text1" />
<Label x:Name="text2" />
<Label x:Name="text3" />
<Label x:Name="text4" />
</StackLayout>
<Image x:Name="EntityImage" Margin="10" Grid.Row="0" Grid.Column="1"/>
<!-- End of Top -->

<!-- Middle part of the screen where the questions are displayed about the entity-->
<StackLayout x:Name="Questions" Margin="5,10,10,0" Grid.Row="1" Grid.ColumnSpan="2">
<Label Text="Questions" FontSize="Large"/>
<BoxView Color="Black" WidthRequest ="100" HeightRequest="1"/>
<ScrollView>
<ListView x:Name="QuestionListView"
HasUnevenRows="True"
ItemTapped="OnItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout x:Name="ListItem" Orientation="Horizontal" >
<multiplechoices:MultipleChoice x:Name="multi" IsVisible="{Binding isMultipleChoice} "/>
<multiplechoices:TrueFalse IsVisible="{Binding isTrueFalse}"/>
<multiplechoices:Text IsVisible="{Binding isText}"/>
<multiplechoices:LineText IsVisible="{Binding isLineText}"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollView>
</StackLayout>
<!-- End of Middle -->

<!-- Bottem part of the screen where you can put a note of the entity and save your info-->
<StackLayout x:Name="Extra" Margin="0,10,30,5" Grid.Row="2" Grid.ColumnSpan="2">
<Label Text="Opmerkingen" FontSize="Large"/>
<BoxView Color="Black" WidthRequest ="100" HeightRequest="1"/>
<CustomElements:CustomEditor PlaceHolder="Schrijf hier een opmerking..."/>
<Button Text="Opslaan" HorizontalOptions="EndAndExpand" BackgroundColor="#AB001C" TextColor="White"/>
</StackLayout>
<!-- End of Bottom -->

</Grid>
</ContentPage>


Here you have te part where i define what my items are. In a writeline i can see that all 12 items are added to the itemsource. So i doubt the issue is in here, but for the sake of it here is the code behind:



 public partial class DetailPage : ContentPage
{

public Subject sb;
int i;
public DetailPage(Subject subject)
{
InitializeComponent();

sb = subject;
TapGestureRecognizer tap = new TapGestureRecognizer();
EntityImage.Source = ImageSource.FromFile("nobody_moriginal.jpg");
text1.Text = subject.text1;
text2.Text = subject.text2;
text3.Text = subject.text3;
text4.Text = subject.text4;

tap.Tapped += OnTap;
BasicInfo.GestureRecognizers.Add(tap);

QuestionListView.ItemsSource = new List<Question>
{
new Question
{
Vraag = "1+1=?",
TypeQuestion = Question.QuestionTypes.MulptipleChoice
},
new Question
{
Vraag= "Is dit waar?",
TypeQuestion = Question.QuestionTypes.TrueFalse
},
new Question
{
Vraag= "Hoe ziet jou leven eruit?",
TypeQuestion = Question.QuestionTypes.Text
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
}, new Question
{
Vraag= "Hoe ziet jou leven eruit?",
TypeQuestion = Question.QuestionTypes.Text
}, new Question
{
Vraag= "Hoe ziet jou leven eruit?",
TypeQuestion = Question.QuestionTypes.Text
}
};
}

private async void OnTap(object sender, EventArgs e)
{
await Navigation.PushAsync(new BasicInfoPage(sb));
}

private void OnItemTapped(object sender, ItemTappedEventArgs e)
{
if (e == null) return; // has been set to null, do not 'process' tapped event
((ListView)sender).SelectedItem = null; // de-select the row
}


Thank you in advance!










share|improve this question
















Hello fellow Xamarin victim,



I'm having an issue with my ListView, where not all items from the itemsource are shown. 6 of the in total 12 items are shown. Here you have my XAML Page where you can see how i use the listview (the listview is used in the middlepart):



<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Prototype_Deinceps.views.subject.DetailPage"
xmlns:multiplechoices="clr-namespace:Prototype_Deinceps.viewincludes.QuestionTypes;assembly=Prototype_Deinceps"
xmlns:CustomElements="clr-namespace:Prototype_Deinceps.CustomElements;assembly=Prototype_Deinceps"
Title="Detail">
<!-- ToolBar -->
<ContentPage.ToolbarItems>
<ToolbarItem Icon="Edit.png">
<ToolbarItem.Text>
<OnPlatform x:TypeArguments="x:String"
iOS="Wijzig"/>
</ToolbarItem.Text>
</ToolbarItem>
</ContentPage.ToolbarItems>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="6*" />
<RowDefinition Height= "9*" />
<RowDefinition Height="6*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<!-- Top part of the screen that consist of basic info of the entity-->
<StackLayout x:Name="BasicInfo" Margin="10,10,10,5" Grid.Row="0" Grid.Column="0">
<Label Text="Basic Info" FontSize="Large"/>
<BoxView Color="Black" WidthRequest ="100" HeightRequest="1"/>
<Label x:Name="text1" />
<Label x:Name="text2" />
<Label x:Name="text3" />
<Label x:Name="text4" />
</StackLayout>
<Image x:Name="EntityImage" Margin="10" Grid.Row="0" Grid.Column="1"/>
<!-- End of Top -->

<!-- Middle part of the screen where the questions are displayed about the entity-->
<StackLayout x:Name="Questions" Margin="5,10,10,0" Grid.Row="1" Grid.ColumnSpan="2">
<Label Text="Questions" FontSize="Large"/>
<BoxView Color="Black" WidthRequest ="100" HeightRequest="1"/>
<ScrollView>
<ListView x:Name="QuestionListView"
HasUnevenRows="True"
ItemTapped="OnItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout x:Name="ListItem" Orientation="Horizontal" >
<multiplechoices:MultipleChoice x:Name="multi" IsVisible="{Binding isMultipleChoice} "/>
<multiplechoices:TrueFalse IsVisible="{Binding isTrueFalse}"/>
<multiplechoices:Text IsVisible="{Binding isText}"/>
<multiplechoices:LineText IsVisible="{Binding isLineText}"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollView>
</StackLayout>
<!-- End of Middle -->

<!-- Bottem part of the screen where you can put a note of the entity and save your info-->
<StackLayout x:Name="Extra" Margin="0,10,30,5" Grid.Row="2" Grid.ColumnSpan="2">
<Label Text="Opmerkingen" FontSize="Large"/>
<BoxView Color="Black" WidthRequest ="100" HeightRequest="1"/>
<CustomElements:CustomEditor PlaceHolder="Schrijf hier een opmerking..."/>
<Button Text="Opslaan" HorizontalOptions="EndAndExpand" BackgroundColor="#AB001C" TextColor="White"/>
</StackLayout>
<!-- End of Bottom -->

</Grid>
</ContentPage>


Here you have te part where i define what my items are. In a writeline i can see that all 12 items are added to the itemsource. So i doubt the issue is in here, but for the sake of it here is the code behind:



 public partial class DetailPage : ContentPage
{

public Subject sb;
int i;
public DetailPage(Subject subject)
{
InitializeComponent();

sb = subject;
TapGestureRecognizer tap = new TapGestureRecognizer();
EntityImage.Source = ImageSource.FromFile("nobody_moriginal.jpg");
text1.Text = subject.text1;
text2.Text = subject.text2;
text3.Text = subject.text3;
text4.Text = subject.text4;

tap.Tapped += OnTap;
BasicInfo.GestureRecognizers.Add(tap);

QuestionListView.ItemsSource = new List<Question>
{
new Question
{
Vraag = "1+1=?",
TypeQuestion = Question.QuestionTypes.MulptipleChoice
},
new Question
{
Vraag= "Is dit waar?",
TypeQuestion = Question.QuestionTypes.TrueFalse
},
new Question
{
Vraag= "Hoe ziet jou leven eruit?",
TypeQuestion = Question.QuestionTypes.Text
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
},
new Question
{
Vraag= "Wat vind u van Tim?(Max 150 karakters)",
TypeQuestion = Question.QuestionTypes.LineText
}, new Question
{
Vraag= "Hoe ziet jou leven eruit?",
TypeQuestion = Question.QuestionTypes.Text
}, new Question
{
Vraag= "Hoe ziet jou leven eruit?",
TypeQuestion = Question.QuestionTypes.Text
}
};
}

private async void OnTap(object sender, EventArgs e)
{
await Navigation.PushAsync(new BasicInfoPage(sb));
}

private void OnItemTapped(object sender, ItemTappedEventArgs e)
{
if (e == null) return; // has been set to null, do not 'process' tapped event
((ListView)sender).SelectedItem = null; // de-select the row
}


Thank you in advance!







c# xaml xamarin xamarin.forms portable-class-library






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 25 '17 at 5:26









Mike Darwish

1,56423058




1,56423058










asked Feb 14 '17 at 10:12









DicebleDiceble

3611316




3611316













  • you did not need to use scrollview with listview, by default each list view have internal scrollview

    – Mike Darwish
    Feb 14 '17 at 11:17











  • As far as I remember, listview is scrollable by default. I would try another approach, with a Listview as a parent of all of them, and the grid bound inside it. Guessing, your grid is limiting the number of record you are showing.

    – Elias MP
    Feb 14 '17 at 11:28






  • 1





    @MikeDarwish You are right, and that also was the problem thanks for reminding me.

    – Diceble
    Feb 14 '17 at 12:46











  • you welcome , I add an answer :)

    – Mike Darwish
    Feb 14 '17 at 12:53



















  • you did not need to use scrollview with listview, by default each list view have internal scrollview

    – Mike Darwish
    Feb 14 '17 at 11:17











  • As far as I remember, listview is scrollable by default. I would try another approach, with a Listview as a parent of all of them, and the grid bound inside it. Guessing, your grid is limiting the number of record you are showing.

    – Elias MP
    Feb 14 '17 at 11:28






  • 1





    @MikeDarwish You are right, and that also was the problem thanks for reminding me.

    – Diceble
    Feb 14 '17 at 12:46











  • you welcome , I add an answer :)

    – Mike Darwish
    Feb 14 '17 at 12:53

















you did not need to use scrollview with listview, by default each list view have internal scrollview

– Mike Darwish
Feb 14 '17 at 11:17





you did not need to use scrollview with listview, by default each list view have internal scrollview

– Mike Darwish
Feb 14 '17 at 11:17













As far as I remember, listview is scrollable by default. I would try another approach, with a Listview as a parent of all of them, and the grid bound inside it. Guessing, your grid is limiting the number of record you are showing.

– Elias MP
Feb 14 '17 at 11:28





As far as I remember, listview is scrollable by default. I would try another approach, with a Listview as a parent of all of them, and the grid bound inside it. Guessing, your grid is limiting the number of record you are showing.

– Elias MP
Feb 14 '17 at 11:28




1




1





@MikeDarwish You are right, and that also was the problem thanks for reminding me.

– Diceble
Feb 14 '17 at 12:46





@MikeDarwish You are right, and that also was the problem thanks for reminding me.

– Diceble
Feb 14 '17 at 12:46













you welcome , I add an answer :)

– Mike Darwish
Feb 14 '17 at 12:53





you welcome , I add an answer :)

– Mike Darwish
Feb 14 '17 at 12:53












2 Answers
2






active

oldest

votes


















3














By Default ListView Have internal ScrollView, So you did not need to use ScrollView on your case.






share|improve this answer

































    0














    you use ListView inside ScrollView. So maybe all of your items is in ListView, but you can't scroll to them.






    share|improve this answer
























    • i can scroll through my listview. It just gets cut off at the 6th item

      – Diceble
      Feb 14 '17 at 10:45






    • 1





      Maybe I'm wrong. But try it without scrolview

      – Vita
      Feb 14 '17 at 12:44











    • No, you are right. I tried it without the scrollview and it works. Thanks for the help!:)

      – Diceble
      Feb 14 '17 at 12:47











    • You welcome.... If you're really needed to have listview inside scrollview then look on NestedScrollingEnabled

      – Vita
      Feb 14 '17 at 13:53











    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f42223318%2fxamarin-froms-listview-not-all-items-are-shown%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    By Default ListView Have internal ScrollView, So you did not need to use ScrollView on your case.






    share|improve this answer






























      3














      By Default ListView Have internal ScrollView, So you did not need to use ScrollView on your case.






      share|improve this answer




























        3












        3








        3







        By Default ListView Have internal ScrollView, So you did not need to use ScrollView on your case.






        share|improve this answer















        By Default ListView Have internal ScrollView, So you did not need to use ScrollView on your case.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 15 '18 at 16:08

























        answered Feb 14 '17 at 12:52









        Mike DarwishMike Darwish

        1,56423058




        1,56423058

























            0














            you use ListView inside ScrollView. So maybe all of your items is in ListView, but you can't scroll to them.






            share|improve this answer
























            • i can scroll through my listview. It just gets cut off at the 6th item

              – Diceble
              Feb 14 '17 at 10:45






            • 1





              Maybe I'm wrong. But try it without scrolview

              – Vita
              Feb 14 '17 at 12:44











            • No, you are right. I tried it without the scrollview and it works. Thanks for the help!:)

              – Diceble
              Feb 14 '17 at 12:47











            • You welcome.... If you're really needed to have listview inside scrollview then look on NestedScrollingEnabled

              – Vita
              Feb 14 '17 at 13:53
















            0














            you use ListView inside ScrollView. So maybe all of your items is in ListView, but you can't scroll to them.






            share|improve this answer
























            • i can scroll through my listview. It just gets cut off at the 6th item

              – Diceble
              Feb 14 '17 at 10:45






            • 1





              Maybe I'm wrong. But try it without scrolview

              – Vita
              Feb 14 '17 at 12:44











            • No, you are right. I tried it without the scrollview and it works. Thanks for the help!:)

              – Diceble
              Feb 14 '17 at 12:47











            • You welcome.... If you're really needed to have listview inside scrollview then look on NestedScrollingEnabled

              – Vita
              Feb 14 '17 at 13:53














            0












            0








            0







            you use ListView inside ScrollView. So maybe all of your items is in ListView, but you can't scroll to them.






            share|improve this answer













            you use ListView inside ScrollView. So maybe all of your items is in ListView, but you can't scroll to them.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Feb 14 '17 at 10:40









            VitaVita

            614




            614













            • i can scroll through my listview. It just gets cut off at the 6th item

              – Diceble
              Feb 14 '17 at 10:45






            • 1





              Maybe I'm wrong. But try it without scrolview

              – Vita
              Feb 14 '17 at 12:44











            • No, you are right. I tried it without the scrollview and it works. Thanks for the help!:)

              – Diceble
              Feb 14 '17 at 12:47











            • You welcome.... If you're really needed to have listview inside scrollview then look on NestedScrollingEnabled

              – Vita
              Feb 14 '17 at 13:53



















            • i can scroll through my listview. It just gets cut off at the 6th item

              – Diceble
              Feb 14 '17 at 10:45






            • 1





              Maybe I'm wrong. But try it without scrolview

              – Vita
              Feb 14 '17 at 12:44











            • No, you are right. I tried it without the scrollview and it works. Thanks for the help!:)

              – Diceble
              Feb 14 '17 at 12:47











            • You welcome.... If you're really needed to have listview inside scrollview then look on NestedScrollingEnabled

              – Vita
              Feb 14 '17 at 13:53

















            i can scroll through my listview. It just gets cut off at the 6th item

            – Diceble
            Feb 14 '17 at 10:45





            i can scroll through my listview. It just gets cut off at the 6th item

            – Diceble
            Feb 14 '17 at 10:45




            1




            1





            Maybe I'm wrong. But try it without scrolview

            – Vita
            Feb 14 '17 at 12:44





            Maybe I'm wrong. But try it without scrolview

            – Vita
            Feb 14 '17 at 12:44













            No, you are right. I tried it without the scrollview and it works. Thanks for the help!:)

            – Diceble
            Feb 14 '17 at 12:47





            No, you are right. I tried it without the scrollview and it works. Thanks for the help!:)

            – Diceble
            Feb 14 '17 at 12:47













            You welcome.... If you're really needed to have listview inside scrollview then look on NestedScrollingEnabled

            – Vita
            Feb 14 '17 at 13:53





            You welcome.... If you're really needed to have listview inside scrollview then look on NestedScrollingEnabled

            – Vita
            Feb 14 '17 at 13:53


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f42223318%2fxamarin-froms-listview-not-all-items-are-shown%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            The Sandy Post

            Danny Elfman

            Pages that link to "Head v. Amoskeag Manufacturing Co."