Forum Xamarin.Android

The type 'ListView' does not support direct content.

I am trying to complete the ListView Tutorial, I believe I have followed the instructions, yet I get an error message: The type 'ListView' does not support direct content.
How can I solve this problem?
ashsofdev

Best Answer

  • jezhjezh Member, Xamarin Team Xamurai
    Accepted Answer

    Why do you put an internal Listview into an external Listview?

    You can try to remove one Listview:

            <StackLayout Margin="20,35,20,20">
                <ListView  ItemsSource="{Binding Monkeys}" >
    
                </ListView>
            </StackLayout>
    

Answers

  • jezhjezh Member, Xamarin Team Xamurai
    Accepted Answer

    Why do you put an internal Listview into an external Listview?

    You can try to remove one Listview:

            <StackLayout Margin="20,35,20,20">
                <ListView  ItemsSource="{Binding Monkeys}" >
    
                </ListView>
            </StackLayout>
    
  • @jezh said:
    Why do you put an internal Listview into an external Listview?

    You can try to remove one Listview:

            <StackLayout Margin="20,35,20,20">
                <ListView  ItemsSource="{Binding Monkeys}" >
    
                </ListView>
            </StackLayout>
    

    Thank You jezh

  • I ran into this same thing. The issue is that you have extra tags. The code should just be the one line ListView tag with ItemsSource defined.

    <?xml version="1.0" encoding="UTF-8" ?>




Sign In or Register to comment.