Adding a button inside an image.

Posted by iSharreth on Stack Overflow See other posts from Stack Overflow or by iSharreth
Published on 2010-04-08T20:28:09Z Indexed on 2010/04/08 20:43 UTC
Read the original article Hit count: 331

CGRect frame = CGRectMake(round((self.view.bounds.size.width - kImageWidth) / 2.0), kTopPlacement, kImageWidth, kImageHeight); self.containerView = [[[UIView alloc] initWithFrame:frame] autorelease]; [self.view addSubview:self.containerView];

// create the initial image view
frame = CGRectMake(0.0, 0.0, kImageWidth, kImageHeight);
self.mainView = [[[UIImageView alloc] initWithFrame:frame] autorelease];
self.mainView.image = [UIImage imageNamed:imagePath];

I want to put a button inside mainview.image. How can I do it?

Any help will be greatly appreciated.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk