This is a migrated thread and some comments may be shown as answers.

Resize List View

2 Answers 134 Views
ListView - Xamarin.iOS
This is a migrated thread and some comments may be shown as answers.
Victor
Top achievements
Rank 1
Victor asked on 15 Apr 2015, 05:12 PM

Is it possible to resize the listview to the size of it's content?

I tried using listView.IntrinsicContentSize.Height, but it always returns -1.

2 Answers, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 16 Apr 2015, 01:25 PM
Hi Victor,

You can use the collectionViewContentSize property of TKListView layout property. Consider the sample below:
CGSize intristicSize = listView.layout.collectionViewContentSize;
listView.frame = CGRectMake(0, 10, intristicSize.width, intristicSize.height);

I hope this helps.

Regards,
Jack
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Victor
Top achievements
Rank 1
answered on 16 Apr 2015, 07:06 PM
Works perfectly.  Thanks!
Tags
ListView - Xamarin.iOS
Asked by
Victor
Top achievements
Rank 1
Answers by
Jack
Telerik team
Victor
Top achievements
Rank 1
Share this question
or