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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:19:34+00:00 2026-05-27T13:19:34+00:00

I have created a UIScrollView and am now trying to place a UIButton over

  • 0

I have created a UIScrollView and am now trying to place a UIButton over the scroll view. However when I build and run the application the scroll view still works fine but I cannot see the UIButton.

I link the UIButton IBOutlet inside the interface builder.

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    scrollView = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
    scrollView.backgroundColor = [UIColor blackColor];
    scrollView.delegate = self;
    scrollView.bounces = NO;

    backgroundImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"auckland-300.jpg"]];

    image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"249a-134206f1d00-1342071f5d9.ImgPlayerAUCKLAND.png"]];

    // Note here you should size the container view appropriately and layout backgroundImage and image accordingly.
    containerView = [[UIView alloc] initWithFrame:CGRectMake(0,0,601,601)];
    playButton = [[UIButton alloc] init]; //test button cannot see it.
    [containerView addSubview:backgroundImage];
    [containerView addSubview:image];

    scrollView.contentSize = containerView.frame.size;
    [scrollView addSubview:containerView];

    scrollView.minimumZoomScale = 0.5;
    scrollView.maximumZoomScale = 31.0;
    [scrollView setZoomScale:scrollView.minimumZoomScale];
    self.view = scrollView;    
}

Any help would be appreciated

  • 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-27T13:19:35+00:00Added an answer on May 27, 2026 at 1:19 pm

    Everything seems ok. But I think the reason you are not able to see the button playButton is because you are not adding it to the view itself.

    Dont you need to do this ? [containerView addSubview:playButton];

    To help you out, here’s what I do for debugging –

    UIView implements a useful description method. In addition, it
    implements a recursiveDescription method that you can call to get a
    summary of an entire view hierarchy.

    NSLog(@"%@", [controller.view recursiveDescription]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Erica Sadun's scroll view example I created a project. I now have a
I have created a scrolling/zooming image view by placing a UIImageView within a UIScrollView.
I have a Custom Scroll View, subclassing UIScrollView . I have added a scroll
I have created a UIScrollView in a cocos2d application. I am adding sprites dynamically,
I have two little problems with my UIScrollView. I managed to create scroll view,
I have created sample circular UIScrollview.it works fine.but i want to scroll through NSTimer
I have a view with a UIScrollView, UIImageView for a background, and a UITextView.
I have created a UIScrollView (canvas.scrollview) and have a custom UIView (canvas) inside it.
I have created a UIScrollView in my app - adapted from this sample code:
I have a UIScrollView and a UIImageView which I have created programmatically without interface

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.