And for the resize to work properly, you need to call it after the data has been added to the listview.