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

View Single Post
Old 03-05-2010, 08:51 AM   #25 (permalink)
Flexicoder
Registered Member
 
Join Date: Aug 2009
Posts: 25
Flexicoder is on a distinguished road
Default

Quote:
Originally Posted by mycatsnameisbernie View Post
After spending way too much time on this, I finally have some code that I am happy with. I solved the two problems from my previous post as follows:
  1. I added the full image of the track as a UIImageView instead of making it the UISlider's background image. This avoids the "squishing" of the edges of the track as the slider moves. It also allows the UISlider to be smaller than the track, so there is no longer a need to add transparent padding to the thumb image.
  2. I implemented the "shimmering" text animation using the method in this post.

You can download an XCode project containing my code here.

There are 2 issues that could use improvement if anyone else wants to try...
  1. The text animation is done using a repeating NSTimer to programatically shift the text highlighting. I would have preferred to have the iPhone's graphics engine perform the animation. I couldn't figure out how to do this with Core Animation on the iPhone. I think it could be done with CA on OS X using CALayer mask layers, but mask layers are not supported on iPhone OS. It might be possible with OpenGL, but I don't have any expertise in that area.
  2. The text rendering code only supports Roman alphabets. In order to support Asian or other non-Roman alphabets, the text drawing code needs to be modified to use glyphs instead of characters.

Hope this helps...
Thanks for putting the effort in to make a working project so we can see it in action. I'm using the control in a project I'm writing and I've noticed that you have to hold the thumb image before it will start sliding.

Has anyone else noticed this? Is it just me, the standard Unlock picks up your finger movement straight away?
__________________
A hopeful games developer
iMediLog
Save With Katie
Containment
Containment FREE
Flexicoder is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,534
Threads: 94,052
Posts: 402,640
Top Poster: BrianSlick (7,979)
Welcome to our newest member, bppnorml12
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:43 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.