implementing a cyclic UITableView

后端 未结 5 475
别跟我提以往
别跟我提以往 2020-12-31 23:10

What is the best way to implement a cyclic UITableView where instead of showing white space when the user scrolls up to the table\'s bounds, it simply wraps round cyclically

5条回答
  •  一个人的身影
    2021-01-01 00:02

    Yes, it is possible to make a cyclic UITableView. You simply pass a really large number as the number of rows and then for each row the table view requests, you pass it the row_number % number_of_rows, so you are always iterating within your data even if the row number is ridiculously large.

    You can see an example here: http://dev.doukasd.com/2011/04/infinite-scrolling-dial-control-for-ios/

    Basically it's like UIPickerView implemented with a UITableView.

提交回复
热议问题