Hello there,
I have a viewController with a .xib that includes a header image at the top of the screen, and a scroll view at the bottom of the screen. I can scroll up and down through the image I have set in the scroll view, what I would like to do is create a bunch of different clickable areas within that scroll view.
SEE IMAGE:
https://www.dropbox.com/s/e6bo7zqzsltp9y2/clickArea.png
Can anybody recommend the best way to go about creating buttons that are clickable on each of those green areas?
Would I create buttons programmatically and place them at the proper x,y coordinate so they can be placed in the scrollView even in the areas not visible on load, but only visible when they are scrolled down to?
How do I create buttons that are INSIDE the scrollview?
Right now, I have, in the header file:
IBOutlet UIScrollView *scrollView;
@property (nonatomic, retain) UIView *scrollView;
and in the .m file in viewDidLoad:
[scrollView setBackgroundColor:[UIColor blackColor]];
[scrollView setCanCancelContentTouches:NO];
scrollView.clipsToBounds = YES;
scrollView.indicatorStyle = UIScrollViewIndicatorStyleBlack;
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"clickAreas.png"]];
[scrollView addSubview:imageView];
[scrollView setContentSize:CGSizeMake(imageView.frame.size.wid th, imageView.frame.size.height)];
[scrollView setScrollEnabled:YES];
[imageView release];
This loads the image and allows me to scroll through it, just not sure how to add buttons so that each of those areas can be clicked.
THANK YOU VERY MUCH IN ADVANCE FOR YOUR HELP! ^_^