ios - Auto Layout in camera overlay view - can't center button vertically -
i trying add together overlay camera. that, i've created next event method:
- (ibaction)takephoto:(id)sender { uiimagepickercontroller *imagepicker = [[uiimagepickercontroller alloc] init]; if ([uiimagepickercontroller issourcetypeavailable:uiimagepickercontrollersourcetypecamera]){ [imagepicker setsourcetype:uiimagepickercontrollersourcetypecamera]; imagepicker.showscameracontrols = no; imagepicker.navigationbarhidden = yes; imagepicker.toolbarhidden = yes; imagepicker.wantsfullscreenlayout = yes; // overlay // insert overlay self.overlay = [[overlayviewcontroller alloc] initwithnibname:@"overlayview" bundle:nil]; //[self.overlay.view settranslatesautoresizingmaskintoconstraints:no]; self.overlay.pickerreference = imagepicker; imagepicker.cameraoverlayview = self.overlay.view; imagepicker.delegate = self.overlay; [self presentviewcontroller:imagepicker animated:no completion:nil]; } else{ [imagepicker setsourcetype:uiimagepickercontrollersourcetypephotolibrary]; [imagepicker setdelegate:self]; [self presentviewcontroller:imagepicker animated:yes completion:nil]; } }
the button centered in view this.
but when used, appears on iphone 4. not centered vertically. if seek pin button slikaj on bottom, not visible because iphone 4 screen size smaller iphone 5. utilize auto layout checkbox checked (turned on). doing wrong?
your overlay view has reason frame dimensions. can prepare assigning imagepicker
frame dimensions overlay view.
self.overlay = [[overlayviewcontroller alloc] initwithnibname:@"overlayview" bundle:nil]; self.overlay.pickerreference = imagepicker; self.overlay.frame = imagepicker.cameraoverlayview.frame; imagepicker.cameraoverlayview = self.overlay.view; imagepicker.delegate = self.overlay;
ios autolayout
No comments:
Post a Comment