0

enter image description here

I have a static UITableView which uses inline pickers to allow the user to change various properties. The pickers are in the cells underneath their corresponding value cell and are hidden away until the user taps on the cell above.

There are 3 sections with a total of 8 picker views in the table.

My problem is that when the user first scrolls down on the table view (to sections 2 and 3 - where there are 5 pickers) the scrolling is ridiculously choppy; it makes for bad user experience.

What is happening is that as the user is scrolling, the picker views are being loaded and because both of those events are occurring on the main thread, scrolling is rubbish.

Is there any way to improve the performance?

BYZZav
  • 1,418
  • 1
  • 19
  • 35

1 Answers1

0

1.  The performance can affect if data values/Array of UIPickerView is populated after didSelectRowAtIndexPath:index, so presumming the values are already there, If you using

static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
then you get considerable improved performance even if you have problem with UIPicker inside a cell as only first visible cells will be initialized once and later ones will resuse.

2.   Another solution can be to have a detailled VC for selecting one among various values OR having a UITableView inside UITableViewCell for showing multiple values instead of UIPickerView. Reference link1 Hope this helps.

Community
  • 1
  • 1
Vacca
  • 1,219
  • 16
  • 26