Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-29-2010, 10:21 PM   #2 (permalink)
965Studios
Registered Member
 
Join Date: Jun 2010
Location: Ohio
Posts: 27
965Studios is on a distinguished road
Default 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];
965Studios is offline   Reply With Quote
 

» Advertisements
» Online Users: 354
10 members and 344 guests
Domele, esoteric, HemiMG, ipodphone, minglei, Newbie123, online-loans70, PavelSea, thephotographer, TomTool
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,568
Threads: 94,081
Posts: 402,751
Top Poster: BrianSlick (7,990)
Welcome to our newest member, online-loans70
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:29 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.