Slow/jittery performance with ListBox scroll on iOS

I'm getting really slow & jittery performance on an iPhone 3 running iOS 7.1 with a scrolling ListBox. 

Its using a custom row component. I've tried using setOpaque(true) on the row component and its children, but that does not seem to have made any difference in performance. I'm also using OpenGL. 

Anything I should look at to get smooth scrolling performance on iOS? 

 

 

You have to use a profiler for stuff like this. iOS is a very different beast to OS X/Win so the bottlenecks could be in different places.

I found it was best to use a native list box on iOS. It gave far the best peformance and feel.

Thanks. Having some issues with the Xcode instruments rebooting the device whenever I try and run the profiler. I tested with a basic listbox in a new project and the performance is fine, so its probably something to do with my code. I'm also struggling with incredibly long build times for release builds - up to about 10 mins at a time spent on the linking stage. 

I'll have a look at using a native listview / UITableListView. In some ways I'd like to use native UI for navigation and list elements as they make smooth transitions and scrolling so much better. For iOS this is not so bad sd we have the UIViewComponent class but for Android this is a whole other kettle of fish and requires a fair bit of restructuring. 

Anyhow, I'll report back with my findings when I manage to get the profiler working. 

Hi – JUCE noob here coming across the same issue 5 years later. I recently put together my first JUCE GUI prototype that makes heavy use of a large (Table)ListBox, and the scrolling is extremely slow/jittery on iOS exactly as you described. My Mac OS and Linux builds don’t have this problem at all.

I’m guessing that you’re the same person who gave this great presentation:

If so, it sounds like you solved this problem by using iOS-native UI elements and ditching the ListBox altogether…

I was hoping to avoid that route, especially since my iOS build works great otherwise – the only issue is the scrollability of lists. Unfortunately that one issue is crippling for UX since a primary feature of the app is the ability to quickly scroll through long lists of patch names.

So as a last-ditch effort before I dive into the world of iOS development (where I have zero experience), I was hoping to find out two things:

  1. Is there anything I can do in JUCE (tricks, using different classes, etc) that would improve the scrolling performance of a TableListBox in iOS? Have there been any improvements/workarounds since this original post?
  2. If my only UI concern is list-scrolling performance, what is the least-invasive way to fix that with iOS-native code? i.e. could I somehow replace my TableListBox with a native UITableListView but keep the rest of my UI in JUCE?

Thanks,
Keith

I replaced Juce Viewport with native iOS UIScrollView

Here is gist of my Viewport. You can modify ListBox or TableListBox to use this Viewport and it will work great on iOS.

Most important part is in ios_viewport.mm.
Once added to project make sure to specify that ios_viewport.mm is Objective-C++ in Xcode and you added flag “-fno-objc-arc” to compiler schema.

3 Likes

This a great solution that will work for the use case where you just need scrollable lists.

If you need ViewController screen “push” type behaviour as well, and other “swipeable” UI elements, I would consider switching things around so that you build a native app and pull in JUCE as a library.

1 Like

Thank you both so much! For my case the ios_viewport seems perfect since list scrolling is the only performance issue I’m having, and that class seems to be exactly what I need.

I’ve made a decent effort to keep the logic of my model/view/controller separate so if I decide to convert the UI to native iOS it hopefully won’t be too painful.

1 Like