如何更改UIImagePickerController
的尺寸宽度iPad
?我可以改变高度,所以它是700,但不能改变宽度,它仍然是320. 我的代码。如何在iPad上更改UIImagePickerController的大小宽度?
UIImagePickerController* imagePicker=[[UIImagePickerController alloc]init];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.delegate=self;
CGRect myRect = CGRectMake(imagePicker.view.frame.origin.x, imagePicker.view.frame.origin.y, 720, 700);
imagePicker.view.frame = myRect;
self.popover = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
myRect = CGRectMake(100, 880, 900, 900);
CGRect re2 = CGRectMake(0,0,800,800);
[self.popover setPopoverContentSize:re2.size];
[self.popover presentPopoverFromRect:[self.view bounds] inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
[self.popover presentPopoverFromRect:myRect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
[self.popover setPopoverContentSize:re2.size];
为什么要从两个不同的rects提交两次popover?另外,不需要设置imagePicker的框架,因为它是弹出窗口的内容视图控制器,并且在设置弹出窗口contentSize时将设置其大小。 – rdelmar