Here's what I ended up doing..
If anyone is interested, here is what I ended up doing:
//Choose the image for the button
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"sp6-1.png"]];
//Position it at the x,y desired
CGRect sixFrame = CGRectMake(30, 18, imageView.frame.size.width, imageView.frame.size.height);
imageView.frame = sixFrame;
// Buttons are defined in .h as such:
// UIButton *sP1Btn;
//Programmatically add the button to the screen, set its frame, image, and action when tapped:
sP1Btn = [UIButton buttonWithType:UIButtonTypeCustom];
sP1Btn.frame = sixFrame;
[sP1Btn setBackgroundImage:imageView.image forState:UIControlStateNormal & UIControlStateHighlighted & UIControlStateSelected];
[sP1Btn addTarget:self action:@selector(sP1Tapped: ) forControlEvents:UIControlEventTouchUpInside];
// Add the button (as a subview) to my scrollView and release the variable:
[scrollView addSubview:sPea1Btn];
[imageView release];
|