title: UIButtons over a UIImageView Zooming
body: <p>I am pretty new to iphone programming. I just started about a month ago and have only been tinkering with small tutorial type applications but anyways, here is my question.</p>
  <p>I currently have a UIScrollView thats scrollable and zoomable, that loads a UIImageView subview, and i want to add in some controls(UIButtons) over the image view but when i zoom in and out the whole group(the buttons and the image) zoom togeather.</p>
  <p>If I add the UIButtons to my UIScrollView and zoom, the image zooms and the buttons stay in origional place</p>
  <p>If I add the UIButtons to my UIImageView they zoom correctly but arent buttons anymore. IE they lose their interactivity.</p>
  <p>Later ill add lots of buttons into an array and add them.</p>
  <p>I would appreciate any help i can get</p>
  <p>This is part of my mainViewController.m:</p>
  <pre><code>- (void)viewDidLoad
  </code></pre>
  <p>{</p>
  <p>[scrollView2 setBackgroundColor:[UIColor blackColor]];</p>
  <pre><code>[scrollView2 setCanCancelContentTouches:NO];
  
  scrollView2.clipsToBounds = YES;    // default is NO, we want to restrict drawing within our scrollview
  scrollView2.indicatorStyle = UIScrollViewIndicatorStyleWhite;
  scroll2ImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@&quot;bigNH.jpg&quot;]];
  [scrollView2 addSubview:scroll2ImageView];
  [scrollView2 setContentSize:CGSizeMake(scroll2ImageView.frame.size.width, scroll2ImageView.frame.size.height)];
  scrollView2.minimumZoomScale = .5;
  scrollView2.maximumZoomScale = 3;
  scrollView2.delegate = self;
  [scrollView2 setScrollEnabled:YES];
  
  
  
  
  UIButton *myButton = [UIButton buttonWithType:UIButtonTypeCustom];
  
  CGRect newSize = CGRectMake(658, 435, 50, 50); // position in the parent view and set the size of the button
  myButton.frame = newSize;
  [myButton setImage:[UIImage imageNamed:@&quot;redStop.png&quot;] forState:UIControlStateNormal];
  // add targets and actions
  [myButton addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
  // add to a view
  [scroll2ImageView addSubview:myButton];
  
  [redLineArray addObject:myButton];
  
  
  [scroll2ImageView release];
  </code></pre>
  <p>}</p>