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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-12-2010, 08:10 AM   #1 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 13
Default How to get a small uiimageview to link to a larger version of the same image.

I am trying to create an app that will just display photos of cars. What i have done is put a uiscroll and lots of small uiimages onto the main screen in the carsviewcontroller.xib. What i want to be able to doo is click on one of these small images to bring it up in full like what happens in the photos app that comes with the iphone - you click on a small image and it brings it up in full. Could you please help me!!! All help is appreciated.
AlexPacteau is offline   Reply With Quote
Old 02-12-2010, 08:26 AM   #2 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 370
Default

resize the UIImage and set it to UIButton or UIImageView and do the rest..
__________________
lazy blogs
The Lord's holy name be praised.
david_david is offline   Reply With Quote
Old 02-12-2010, 02:22 PM   #3 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 13
Default

Quote:
Originally Posted by david_david View Post
resize the UIImage and set it to UIButton or UIImageView and do the rest..
yeah but how do i do the rest and how do i set it as a button and will doing this provide me with the bigger image?
AlexPacteau is offline   Reply With Quote
Old 02-12-2010, 09:16 PM   #4 (permalink)
indie dev
 
rocotilos's Avatar
 
Join Date: Oct 2009
Posts: 2,754
Default

double post

Last edited by rocotilos; 02-12-2010 at 09:19 PM.
rocotilos is offline   Reply With Quote
Old 02-12-2010, 09:17 PM   #5 (permalink)
indie dev
 
rocotilos's Avatar
 
Join Date: Oct 2009
Posts: 2,754
Default

you cannot put a large image on a button.

one way to do it, is placing a UIImageView with property ScaleToFit (or AspectFit) behind a Custom button with no image. Then make sure the button is on top of the Image by Move To Front in interface builder.

Then, hook the button up to IBAction and run this code:

Code:
-(IBAction)showbigimage {

UIImageView *bigimg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yourimage.png"]];

bigimg.contentMode = UIContentModeScaleToFill;
bigimg.frame = CGRectMake(0,0,320,480); // assuming portrait orientation

[self.view addSubview:bigimg];
[bigimg release];

}
rocotilos is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 288
20 members and 268 guests
14DEV, ADY, Bertrand21, Dani77, HemiMG, iDifferent, IphoneSdk, jakerocheleau, JasonR, jimbo, macquitzon216, MACralik, NSeven, prchn4christ, Rudy, silverwiz, spiderguy84, Sunny46
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:59 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0