UIImagePickerController when dismissed pushes view to 20 px up in iOS 6.0 only

前端 未结 4 1240
执笔经年
执笔经年 2021-01-29 04:16

EDIT : I am using UIStoryBoard.

I have presented like this:

UIImagePickerController *imagePicker = [[UIImagePi         


        
4条回答
  •  遇见更好的自我
    2021-01-29 04:47

    I had similar issue on iOS 8.2. After picking video using UIImagePickerController the frame is increased by 20px, top area of view controller is looking good, but the bottom is cut off. The solution is:

    -(void)openPicker {}
        [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
        UIImagePickerController *picker = [[UIImagePickerController alloc] init];
        //configure image picker here
        [self presentViewController:picker animated:YES completion:NULL];
    }
    
    -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
        [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(showStatusBar) userInfo:nil repeats:NO];
        [picker dismissViewControllerAnimated:YES completion:NULL];
    }
    
    -(void)showStatusBar {
        dispatch_async(dispatch_get_main_queue(), ^{
            [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];
        });
    }
    

提交回复
热议问题