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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:15:56+00:00 2026-06-15T00:15:56+00:00

I have 2 scrollviews and 1 imageview . now Inside Main scrollview I have

  • 0

I have 2 scrollviews and 1 imageview.

now Inside Main scrollview I have another scrollview and in this scrollview I have image.

so, my Main Scrollview named “ScrollView” and sub scrollview named “scrView“

now I am able to add “scrView” inside “ScrollView” but I can not see my image inside “scrView“

My coding is as follows:

int numberOfPages = 10;
    [scrollView setPagingEnabled:YES];
    [scrollView setContentSize:CGSizeMake(scrollView.bounds.size.width * numberOfPages, scrollView.bounds.size.height)];

    CGRect pageFrame;
    CGRect imageFrame;
    UIImageView *imageView;

    for(int i=0; i < numberOfPages; i++)
    {
        pageFrame = CGRectMake(i * scrollView.bounds.size.width+50, 0.0f, scrollView.bounds.size.width-100, scrollView.bounds.size.height);
        UIScrollView *scrView = [[UIScrollView alloc] init];
        imageFrame = CGRectMake(i * scrView.bounds.size.width, 0.0f, scrView.bounds.size.width, scrView.bounds.size.height);
        imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image1.jpg"]];
                    [scrView setFrame:pageFrame];
        [imageView setFrame:imageFrame];
        [scrView setBackgroundColor:[UIColor redColor]];

        [scrollView addSubview:scrView];
        [scrView addSubview:imageView];

        [imageView release];
    }

If you look at the code I have added imageView as a subView of scrView but I am not able to see image in simulator.

what is the problem?

share your ideas with me.

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-06-15T00:15:58+00:00Added an answer on June 15, 2026 at 12:15 am

    This is working try this code.Problem was with your imageview frame

    int numberOfPages = 10;
    [scrollView setPagingEnabled:YES];
    [scrollView setContentSize:CGSizeMake(scrollView.bounds.size.width * numberOfPages, scrollView.bounds.size.height)];
    
    CGRect pageFrame;
    CGRect imageFrame;
    UIImageView *imageView;
    
    for(int i=0; i < numberOfPages; i++)
    {
        pageFrame = CGRectMake(i * scrollView.bounds.size.width+50, 0.0f, scrollView.bounds.size.width-100, scrollView.bounds.size.height);
        UIScrollView *scrView = [[UIScrollView alloc] initWithFrame:pageFrame];
        imageFrame = CGRectMake(0.0, 0.0f, scrView.bounds.size.width, scrView.bounds.size.height);
    
        imageView = [[UIImageView alloc] initWithFrame:imageFrame];
        imageView.image=[UIImage imageNamed:@"image1.jpg"];
    
       // [scrView setFrame:pageFrame];
    
        [scrView setBackgroundColor:[UIColor redColor]];
        [scrView addSubview:imageView];
        [scrollView addSubview:scrView];
    
    
        [imageView release];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, so I have this setup ScrollView HorizontalScrollView ImageView I am trying to capture
I have image in a imageview which is placed in a scrollview., Zoom in
I have a scrollview (IBOutlet); in that scrollview I have added an imageview. I
I have a scrollview control that has a StackPanel (Orientation=Vertical) UI Element inside of
i have a textview and imageview inside a linearlayout. textview containes more text so
I have an image view that is inside of a UIScrollView so that I
In Interface Builder I have this hierarchy: View 1.1 Image View //it's my background
I have a scrollview on my view in that i have all the sub
I'm new to iPhone dev and Obj-C and I have several problems with ScrollView/ImageView
I have one scrollView and there is ImageView in it but when i click

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.