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

  • Home
  • SEARCH
  • 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 5981655
In Process

The Archive Base Latest Questions

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

Hello I can’t figure out why UIImageView doesn’t want to show up in UIScrollView.

  • 0

Hello I can’t figure out why UIImageView doesn’t want to show up in UIScrollView.
Now here is a little catch, I am grabbing picture from library and adding it to the UIScrollView – that doesn’t seem to work.

However if I just add picture right at “did load” method then it works just fine:
[code]

UIImageView *tmp = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"P3130016.JPG"]];

[scrollView setScrollEnabled:YES];
[scrollView setContentSize:CGSizeMake(800, 800)];
[scrollView addSubview:imageView];

I don’t know why or where is the issue, please advise!

  • 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-22T21:58:28+00:00Added an answer on May 22, 2026 at 9:58 pm

    I’m slightly confused by your implementation, as you havn’t posted all of your code, you are initilizing a ‘tmp’ imageview but i cannot see where it is used.

    I’m going to persume you need to define the frame of the UIImageView after it has been initialized, currently the UIImageView has no frame and therefore is not drawn within the view.

    You can set the frame like so:

    UIImageView *tmp = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"P3130016.JPG"]];
    
    tmp.frame = CGRectMake(x,y,width,height);
    

    These values need to be float values, where x and y are anchored from the top left of the screen. So CGRectMake(0,0,100,100) would draw a 100 by 100 square in the top left of the screen. You can find more information in the documentation here.

    And then add it to the ScrollView:

    [scrollView addSubview:tmp];
    

    It is also worth noting that your *tmp UIImageView is currently leaking memory, i would suggest adding it to the autorelease pool on initialization:

    UIImageView *tmp = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"P3130016.JPG"]] autorelease];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello Can anyone help me figure out how to solve this bug message? I
Why the #hello can fade out but not show anymore?? thanks! <!DOCTYPE html> <html>
Hello can someone help me in jquery regex? whew coz im stack here since
hello can anyone help me debug little error that my eyes seem to be
i want to call an exe file(abc.exe) from another application(hello) how can i get
Hello can somebody write or point to a good symfony plugin installation tutorial. Here
Hello Can somebody explain why second cout in func(char *p) doesn't work: #include <cstdlib>
hello how can i call in the current view, a method implemented in the
Hello I'm writting junit test how can I test this method .. this is
Can anyone provide me with a hello world example for a major mode 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.