Skip to content

Xamarin.Forms implementation of an auto-height ListView

Notifications You must be signed in to change notification settings

lazylace37/AutoHeightListView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

AutoHeightListView

Xamarin.Forms implementation of an auto-height ListView

I've made this little project because sometimes the default Xamarin.Forms' ListView doesn't calculate its height based on its children, and that can be the reason why you are here.

You can call it like that:

<views:AutoHeightListView HasUnevenRows="True" ItemsSource="{Binding Items}">
    <ListView.Header>
        ...
    </ListView.Header>

    <ListView.ItemTemplate>
        <DataTemplate>
            <ViewCell Height="25">
                <ViewCell.View>
                    <Grid>
                         ...
                    </Grid>
                </ViewCell.View>
            </ViewCell>
        </DataTemplate>
    </ListView.ItemTemplate>
</views:AutoHeightListView>

Now it is working only with HasUnevenRows set to True. The Header height is dynamically retrieved, but I didn't manage to get the ViewCell's View height correctly, so for now I'm forcing the ViewCell's height. You can also use the classic RowHeight property.

Any suggestions will be appreciated.

About

Xamarin.Forms implementation of an auto-height ListView

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages