load the entire ListView in background and get an UIControl inside each ListItem

℡╲_俬逩灬. 提交于 2019-12-31 05:14:13

问题


I need to load a ListView entirely and get an UIControl inside each ListItem even if the item view is not displayed on the screen.

I tried the ChildViewAdded event, but it is raised only when the ListItem is displayed on the screen.

So, I need a way to prepare my UI ListView programmatically before displaying it.

Thanks in advance for your help.


回答1:


Quick answer - if you need a real View for each item in your list then you don't want to use a virtualized control like a ListView.

Instead you can use repeated custom views inside a vertical LinearLayout inside a ScrollView.

If using mvvmcross, you may find a MVXBindableLinearLayout helpful to do this - it has an ItemsSource and a Template just like the MvxBindableListView.


I've no idea whether what you are trying to do makes sense, but the above should help you do it if you want to!

Don't try using a linear layout for lists with lots of items - you'll run out of resources.



来源:https://stackoverflow.com/questions/13075521/load-the-entire-listview-in-background-and-get-an-uicontrol-inside-each-listitem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!