1

I have a scrollview in my view controller.

I'm adding a subview

UIImageView *IMG1 = [[UIImageView alloc] init];
IMG1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"IMAGE.png"]];
[self.view addSubview:IMG1];
IMG1.frame = CGRectMake(20, 20, 35, 35);

So the question is how to add it under my scroller (between scroller and my view)?

5
  • What you have tried so far? your question unclear at least for me. Commented Oct 11, 2013 at 5:55
  • @iAmbitious The image appears above all objects on my view and image is needed to be under all objects on my view. Sorry for my awful english but I can't explain my problem better. Commented Oct 11, 2013 at 6:06
  • Edit your question whatever you tried code so far. Commented Oct 11, 2013 at 6:08
  • @iAmbitious that's all code I have Commented Oct 11, 2013 at 6:14
  • Where is code of scroller and my view?? You added it in your nib file? Commented Oct 11, 2013 at 6:18

1 Answer 1

1

Move this content to ViewDidLoad and add the scrollView after imageView

-(void) viewDidLoad
{
[super viewDidLoad]

UIImageView *IMG1 = [[UIImageView alloc] init];
IMG1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"IMAGE.png"]];
[self.view addSubview:MySubImage];
IMG1.frame = CGRectMake(20, 20, 35, 35);
  [self.view sendSubviewToBack:IMG1];
//// add your scrollView and subViews 
}
Sign up to request clarification or add additional context in comments.

1 Comment

Unfortunately I have a lot of objects made not programmatically

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.