UIPopOver를 통해 표시 할 UIImagePicker의 크기를 변경하려고합니다. 코드는 아래와 같습니다. 문제는 PopOver 크기가 제대로 표시되지 않는다는 것입니다. 간단히 올바른 크기로 깜박이고 일반적인 기본 크기로 애니메이션이 적용됩니다.UIPopOver (iPad)를 통해 표시되는 UIImagePicker의 크기 변경
아무도 내가 팝 오버의 크기를 어떻게 바꿀 수 있는지 알려 줄 수 있습니까?
- (void)showImagePickerForPhotoLibrary {
NSLog(@"Picker");
imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.delegate = self;
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerController.contentSizeForViewInPopover = CGSizeMake(768, 1000);
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
Class cls = NSClassFromString(@"UIPopoverController");
if (cls != nil) {
popoverController = [[UIPopoverController alloc] initWithContentViewController:imagePickerController];
//popoverController.popoverContentSize = CGSizeMake(768, 1000);
[popoverController presentPopoverFromRect:selectedRect inView:self.view permittedArrowDirections:4 animated:YES];
}
}
else {
[app.mainViewController presentModalViewController:imagePickerController animated:YES];
}
}
감사합니다. 어쨌든 iPad 컨테이너의 너비와 높이를 얻을 수 있습니까? containerController.contentSizeForViewInPopover = CGSizeMake (768, 1000); ? – GuybrushThreepwood
ipad 해상도는 768x1024입니다. popover가 전체 화면을 차지하게하려면 CGSizeMake (self.view.frame.size.width, self.view.frame.size.height)를 시도하십시오. – Mutix
이런 종류의 작동은하지만 다른 (이상한) 버그가 발생합니다 : http : //stackoverflow.com/questions/8422636/black-bar-in-uiimagepicker-on-ipad-only-in-landscape-right-orientation – GuybrushThreepwood