4

I have a class that extends UISlider (my custom slider) and i want to change the slider in MPVolumeView (MPVolumeSlider) with my custom slider. I can customize the slider in MPVolumeView but i can't change the track rect bounds. I have a custom slider because i'm overriding the trackRectForBounds method.

How can i assign my custom slider to the MPVolumeView or how can i change the track rect bounds without overriding it.

Thanks in advance.

  • You can not assign your custom slider but you may change the appearance of the MPVolumeSlider by typecasting its instance towards a regular UISlider and customizing it as such. – Till Jan 02 '12 at 12:25
  • ok but how can i change the track for rect bounds. i want my slider track to have 8px height and 223px width. – Marcelo Conceição Jan 02 '12 at 12:30

1 Answers1

0

Use one of your normal custom sliders and internally use a MPMusicPlayerController* to change the volume.

Depending on how you have your slider setup you may also need to catch Volume Change events when the device volume buttons are pressed.

TurqMage
  • 3,321
  • 2
  • 31
  • 52