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 > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 09-11-2011, 12:34 PM   #1 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 26
petros is on a distinguished road
Default Add UIButton on UIImagePicker as a subview

Hi!
I develop an augmented reality application and I have a problem with abutton that I have add as a subview in a uiimagepicker. The problem is that when I tap the button, the button does not respond.
This is my code:
Code:
-(IBAction)Camera{
    UIImagePickerController *imgPicker = [[UIImagePickerController alloc]init];
    imgPicker.allowsEditing = NO;
    imgPicker.delegate = self;
    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){
        imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
        [NSThread detachNewThreadSelector:@selector(AnimationThread) toTarget:self withObject:nil];
        imgPicker.showsCameraControls = NO;
        imgPicker.navigationBarHidden = NO;
        imgPicker.wantsFullScreenLayout = YES;
        CGAffineTransform translate = CGAffineTransformMakeTranslation(0.0, 27.0);
        imgPicker.cameraViewTransform = translate;
        CGAffineTransform scale = CGAffineTransformScale(translate, 1.125, 1.125);
        imgPicker.cameraViewTransform = scale; 
        ShotButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
        [ShotButton addTarget:self action:@selector(Shot) forControlEvents:UIControlEventTouchUpInside];
        ShotButton.frame = CGRectMake(284.0, 442.0, 72.0,37.0);
        ShotButton.center = CGPointMake(284.0, 442.0);   
        imgPicker.cameraOverlayView.userInteractionEnabled = YES;
        [imgPicker.cameraOverlayView addSubview:ShotButton];
        [imgPicker.cameraOverlayView bringSubviewToFront:ShotButton];
        [self presentModalViewController:imgPicker animated:YES];
    }
    [imgPicker release];
}
Than you very much...
petros is offline   Reply With Quote
Old 10-20-2011, 10:11 PM   #2 (permalink)
Registered Member
 
Join Date: Jan 2009
Posts: 113
jonusx is on a distinguished road
Default

Are you subclassing the picker? Thats probable not the best way to do that. Theres some great sample code in the ios dev center for this sort of thing
__________________
What do you have to share? Share and view pics Oneshare

Play Magic: The Gathering? Try The Sylvan Archives!

Warhammer 40k your thing? W40k Manager is your thing.

Like karaoke? Try iSing Karaoke Locator
jonusx 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: 376
8 members and 368 guests
bignoggins, epaga, hussain1982, jcdevelopments, LunarMoon, omagod, pinacate, skog
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,643
Threads: 94,110
Posts: 402,860
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Diligent
Powered by vBadvanced CMPS v3.1.0

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