• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is it possible to set UISlider intervals?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it possible to set UISlider intervals?


  • Subject: Re: Is it possible to set UISlider intervals?
  • From: Bill Garrison <email@hidden>
  • Date: Wed, 18 Aug 2010 22:27:13 -0400

On Aug 10, 2010, at 8:43 PM, Devraj Mukherjee wrote:

> Hi all,
>
> I am using UISliders in my iOS app.
>
> I can't see a way of setting the slide value interval. Is this
> possible? Or do I have to calculate the change based on the 0.1
> increases?
>
> Minimum value set to -20 and Max to 20 and I want the slider to
> increment by 0.5 on a slide.

If you want your slider to increment its value on a graduated scale, you'll have to implement this yourself.

You can use the C library math function 'remainder' for assistance.  See man 3 remainder for documentation.

	UISlider *slider = ...;
	double scaleIncrement = 0.5;
        double scaledValue = slider.value - remainder (slider.value, scaleIncrement);

Or something like that.

Bill_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Is it possible to set UISlider intervals? (From: Devraj Mukherjee <email@hidden>)

  • Prev by Date: Re: Core Data Bindings Issue
  • Next by Date: UIMenuController not showing up
  • Previous by thread: Re: Is it possible to set UISlider intervals?
  • Next by thread: -[NSBrowser setReusesColumns:] broken?
  • Index(es):
    • Date
    • Thread