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 5991579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:24:27+00:00 2026-05-22T23:24:27+00:00

I am facing some problem with UISlider programming. 1) style: I know we have

  • 0

I am facing some problem with UISlider programming.

1) style: I know we have to set the minimum and maximum images. I am just not sure what images and any image reference will be great ? I only want to change from blue to black !

2) also, my code for the UISlider is this :

in header file:

UISlider *slider;

in code file:

 //slider
 CGRect frame=CGRectMake(10, 70, 300, 10);
 photoSlider=[[UISlider alloc] initWithFrame:frame];
 photoSlider.minimumValue=0.0;
 photoSlider.maximumValue=90.0; //maximumPhotoImage
 photoSlider.continuous=NO;
 photoSlider.value=10.0;
 photoSlider.backgroundColor=[UIColor clearColor];
 //photoSlider

 [photoSlider addTarget:self action:@selector(updateImage:)   forControlEvents:UIControlEventValueChanged];
 [self.view addSubview:photoSlider];

- (void) updateImage:(id) sender  
{
   NSLog(@"val: %d",photoSlider.value);
}

The values that I get from the function are 0 at both ends and very large value in between (both positive and negative…random values).

Can anyone kindly help me out ? Thanks.

  • 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-22T23:24:27+00:00Added an answer on May 22, 2026 at 11:24 pm

    For part 1, to replace the default blue part of the slider track with black, you could take a snapshot of the default blue track and convert it to a darker grayscale like this (only need the left end and 1 pixel of the stretchable part):
    enter image description here
    and call setMinimumTrackImage:forState::

    UIImage *minTrackImg = [[UIImage imageNamed:@"MinimumTrackImage.png"] 
        stretchableImageWithLeftCapWidth:4 topCapHeight:0];
    [photoSlider setMinimumTrackImage:minTrackImg forState:UIControlStateNormal];
    

    For part 2, the values logged don’t make sense because the value property is of type float and you need to use %f instead of %d (see String Format Specifiers):

    NSLog(@"val: %f",photoSlider.value);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing some problem in iPhone application development for Reading PDF. I have
I have 2 classes Test(Base)and Program(child). Now I am facing some problem while downcasting.
I am facing some problem with my php session. I have deployed a plugin
I am facing some problem with use of operator == in the following c++
i am facing some problem with files with huge data. i need to skip
I am facing some problem with rails gem when deploying to a differet machine.It
I am facing some problem with MySQL database. actually It was fast when I
I am facing some weird problem when importing .war file into eclipse. The problem
The problem I'm facing is that it seems that some of the files generated
I am facing a very peculiar problem that even when I delete some rows,

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.