What I am doing it creating a UIImageView and hope to add it to a UIScrollingView as its scrolling content, but it never appears. So I tried the following code and the problem is now pretty clear to me. How can I add a subview to another subview?
//in myViewController.m
@synthesize scrollView = _scrollView;
- (void) viewDidLoad{
UIView* simpleView = [[UIView alloc] initWithFrame:CGRectMake(0,0,300,200)];
[simpleView setBackgroundColor: [UIColor BlueColor]];
[self.view addSubview: simpleView] //this would work, the simple view appears
[self.scrollView addSubview: simpleView] //this would not work, the simple view doesn't appear
}
the scrollView property is hooked up with ScollView in the storyboard, which is the only thing in that controller
You need to do this:
Basically add one on top of the other not everything is being stacked on the view. Image on top of view on top of self pretty much