Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3315638
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:22:26+00:00 2026-05-17T22:22:26+00:00

So a UISlider works great to change/choose values but it just doesn’t look that

  • 0

So a UISlider works great to change/choose values but it just doesn’t look that great. What i’d like to implement is more like a horizontally spinning dial. I already have all the graphics I need and i’ve already implemented the scroll view to slide my image left and right.

The problem at this point is that unlick in a UISlider where I can simply call slider.value to get its value, I have no clue how to set a range of values (max and min) and how to get the specific value out of a UIScrollView as it’s scrolling.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:22:26+00:00Added an answer on May 17, 2026 at 10:22 pm

    I have to admit to not being 100% sure how you’re using a scrollview as a slider, but you can use the contentOffset property to get “The point at which the origin of the content view is offset from the origin of the scroll view.”

    You’ll need to do some maths to turn that into the value you want, but it’s simple stuff. Suppose your scroll view is horizontal and has can be scrolled up to 400px across. That is, if contentOffset is 0 then you’re at the start and if contentOffset is 400px then you’re at the end. How you’ve used the scrollview will dictate exactly how you work this out, if you’re desperate then you can just print the value of contentOffset programmatically and observe the range empirically.

    In that case, you can get the proportion of the distance across the scrollview you are at by something like:

    CGFloat proportionOffset = scrollView.contentOffset/400.0f;
    

    If you then want to model the range [startX, endX] then just work out:

    CGFloat offset = startX + proportionOffset * (endX - startX);
    

    proportionOffset ends up in the range 0 to 1, at 0 when contentOffset is 0 and at 1 when contentOffset is 400. If, say, startX is 15 and endX is 35 then endX – startX is 20. If you multiply a number in the range 0 to 1 by 20 then you get a number in the range 0 to 20. That’s how far through your range you want to be. But your range doesn’t necessarily start at 0, so you need to add on the value of startX.

    For efficiency terms, it’s smart to set yourself up as a delegate of the scrollview and check the new contentOffset only when you receive a scrollViewDidScroll:. Otherwise you’re doing a lot of polling that simply isn’t necessary and, at the absolute worst, severely impeding the CPU’s ability to sleep (and hence reduce heat and save battery).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a UISlider in my app but I'd like to use a custom
I wanted a control like the UISlider, but with two thumbs instead of one
I'm trying to implement a custom UISlider (subclass of UISlider), that behaves in a
I am trying to implement JQ UIslider - but I keep running into problems,
I have a UISlider that I wan't to have a custom look for. I
I have made a UISlider work just like the slide to unlock slider. What
I have a (vertical) UISlider inside a UIScrollview. I'd like to be able to
I would like to make the custom UISlider, something like this |o----------| -> |-----O------|
I'm having a great time playing around with knockout js and have just started
I have tried many methods to implement a regular UISlider and control the device

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.