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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:04:24+00:00 2026-05-15T02:04:24+00:00

I want to add a UISlider to my app programmatically without using the IB.

  • 0

I want to add a UISlider to my app programmatically without using the IB.
I am adding a UISlider to my UIViewController using the code below. However I don’t see the slider when the view comes up. What am I missing? I am using iPhone SDK 3.1.2.
Appreciate any help.

@synthesize slider;
....

- (void)viewDidLoad {
...
...
slider = [[UISlider alloc] initWithFrame: CGRectMake(0, 480 - 80, 300, 20)];
slider.minimumValue = 0.0;
slider.maximumValue = 100.0;
slider.tag = 0;
slider.value = 50;
slider.continuous = YES;
slider.enabled = YES;
[slider addTarget:selfaction:@selector(handleSlider:)forControlEvents:UIControlEventValueChanged];
self.view addSubview:slider];

In the .h file

 ...
    UISlider    *slider;
    ...
    @property (nonatomic, retain) UISlider *slider;
    - (void) handleSlider:(id)sender;
  • 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-15T02:04:25+00:00Added an answer on May 15, 2026 at 2:04 am

    Possibilities:

    1. If the slider isn’t the last view added, its likely its being hidden by another view.
    2. The self.view is actually smaller than {0,400}.
    3. The sliders hidden attribute is set to true.
    4. You have more than one view controller active at a time.

    You should check the debugger for the self.view’s subviews and see if the slider is there. If so then it’s almost certainly one of the reasons above.

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

Sidebar

Related Questions

As i know,MPVolumeView can add to my app for changing volume.But now i want
I want add user in ActiveDirectory. I use this code private SPUser CreateUser(string strLoginName,
I want add to my Windows phone app masked textbox, are there ready-made control
I want add days to an NSDate . The approach below is not working.
I try using Devexpress Layout-Control (For costume usage). So I want add all item's
I want add two textview with orientation vertical(One below other) in a table row
I want add duplicate keys in map,output like the one below: google:Android,google:Maps,apple:iPod,apple:iPhone,apple:iOS Is it
I want to add same additional fields to my form, but I don't want
In code i add columns to listview successfuly. But i want add binding to
I want add some resource files (non-code text-based files) to the jar file in

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.