Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-26-2009, 01:03 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 3
SirDuke is on a distinguished road
Cool Performance problem with horizontal UIPicker

I needed a horizontal scrolling view, something like the UIPickerView (but horizontal). So I decided to make it myself. The view I build scrolls with swipes, has momentum and scales its contents accordingly. On the simulator it works fine. The only problem it has is that its performance on the iPhone is too jerky.

In general I made a class that takes an Array of strings and creates a set of UILabels using those strings. Then it places them on a UIView that the user can scroll.

I am attaching a ready-to-run project below in case someone can see what I am doing wrong and if there is something that would justify such a glitchy performance. I am assuming it might be the way I am handling touches, since there seems to be a delay (like half a second) every time the user starts to swipe.
Also in case someone finds it helpful and would like to use it.

http://locus-delicti.com/files/HScroller.zip

If you can't see a problem in the code, maybe you can suggest some similar component that someone else has made... I've seen horizontal scrollers a lot on the AppStore...
SirDuke is offline   Reply With Quote
Old 01-26-2010, 03:37 PM   #2 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 4
pcooperllan is on a distinguished road
Default

Hi,
I was just wondering if you were able to solve this, and if so if you could share the solution?

Thanks,
Paul
pcooperllan is offline   Reply With Quote
Old 01-26-2010, 04:58 PM   #3 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 3
SirDuke is on a distinguished road
Default

Hi pcooperllan,

in the end I used a UIScrollView. Simple as that. I created a very wide UIScrollView to hold all of my content and then on the "viewDidScroll" method, I took care of resizing my view's content according to my needs. The performance is fine in all devices with 2 of those UIScrollViews on the screen, each one holding about 800 subviews.

If you need to create something significantly larger, make sure you also hide/show your subviews when they are not showing to improve performance even more, or even to release them from memory (following the UITableViewCell's reusability paradigm).
SirDuke is offline   Reply With Quote
Old 01-26-2010, 05:31 PM   #4 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 4
pcooperllan is on a distinguished road
Default

Thanks for answering, I'll have a go at writing something with the UIScrollView.

I hope I'm not asking too much, but I don't suppose that you have any sample code which would illustrate how you achieved the UIScrollView based horizontal picker?

Thanks again,
Paul
pcooperllan is offline   Reply With Quote
Old 01-27-2010, 12:10 AM   #5 (permalink)
almostfunnydev
iPhone Dev SDK Supporter
 
rocotilos's Avatar
 
Join Date: Oct 2009
Age: 34
Posts: 3,015
rocotilos is on a distinguished road
Default

I am also using horizontal pickerview. But i didnt make any kind of class. I just apply transform on it and each of the items in it when showing the picker. works ok for me.
rocotilos is offline   Reply With Quote
Reply

Bookmarks

Tags
horizontal scroll, picker, scrolling, uipickerview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 327
13 members and 314 guests
chiataytuday, coolman, givensur, glenn_sayers, guusleijsten, ipodphone, jbro, mediaspree, mottdog, mtl_tech_guy, Punkjumper, vilisei, whitey99
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,114
Posts: 402,883
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:28 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0