views:

415

answers:

3

Is there a way for an application to use the native iPod application (and put its own buttons and stuff on it)? How is that done? Or is it the case that Pandora, for example, has just coded up their interface to look almost exactly like the iPod application? In which case they would have had to, for example, re-create the volumen control that has that fancy knob on it, etc...

+1  A: 

The iPhone SDK provides a large collection of controls that you can leverage in your own application. For example, using the UISlider control in your app will get you a slider that looks like an "iPhone slider". This will give your application a consistent look and feel with respect to other iPhone applications that use the same controls, bringing a familiarity and ease-of-use to the user. In all likelihood Pandora's iPhone app is leveraging these common controls (as well as developing some custom controls of their own.)

fbrereto
Well yeah, but pandora's slider looks exactly like ipod's slider, not like the default. So pandora must have re-engineered the graphics for the minimumTrackImage, thumbImage, etc. Or, they're somehow 'instantiating' the iPod player itself...
Colin
There are customization APIs in the UISlider class; in all likelihood they're using custom images for the thumb and/or track, but it's not that hard to do. I have customized UISlider thumbs before as I've found the default thumbs can be pretty hard to grab sometimes.
fbrereto
A: 

Most of it can be done with interface builder, the rest is Core Animation. If you are talking specifically about accessing the music library on the phone, there is now an official API for that in >= 3.0. Specifically for CoverFlow there is not official Apple resource, but there are lots of open source Coverflow examples floating around the internet.

slf
+10  A: 

I used the standard UIKit classes to make the Pandora the interface to look just like the iPod app. The notable exception is CoverFlow, which I built from the ground-up. For the volume control, check out MPVolumeView. It's also possible to extract graphics from the app bundles of jailbroken iPhones, which I mention only with the standard disclaimer that you're probably violating some contract somewhere if you do so. ;)

Neil Mix
Ah, straight from the source. Thx!
Colin