Programming - cpueblo.com

ImagePicker 사용시에 statusbar 가 노출되는 현상 없애기


글쓴이 : 유광희 날짜 : 2015-03-02 (월) 16:02 조회 : 19634

1. .h 파일에 delegate 를 정의합니다.

@interface yourViewController : UIViewController <UIPickerViewDelegate, UIImagePickerControllerDelegate>; { ... }

2. .m 파일에 willShowViewController 를 정의합니다.

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { [[UIApplication sharedApplication] setStatusBarHidden:YES]; }

3. UIImagepickerController 에 delegate 를 self 로 설정합니다.

UIImagePickerController *imagepickerController = [[UIImagePickerController alloc] init]; [imagepickerController setDelegate:self];