如何更改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