大家好我將設備設置爲橫向模式,在該模式下,按下「照片庫」按鈕時,縱向模式下的圖庫打開,選擇圖片將從畫廊回到風景模式。我想在橫向模式下以橫向模式打開圖庫。雖然iPhone處於橫向模式,但縱向模式下仍然出現光照
我用這個代碼事先而是開照相館
- (void)imagesFromGallery{
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
if(!popover)
{
popover = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
}
[popover presentPopoverFromRect:CGRectMake(500, 620, 0, 0)
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionUp
animated:YES];
}
else
{
[self presentModalViewController:imagePicker animated:YES];
} }
感謝....
照片庫總是以縱向模式打開,您無法將其更改爲橫向模式。但是,如果您獲取所有圖像並製作自己的視圖,則無法進行任何操作。這將是非常乏味的! – 2012-08-02 06:43:20
在發佈這樣的問題之前,請閱讀文檔。 Apple提供所有參考資料是有原因的。搜索文檔所花費的時間要少於發佈此問題的時間。 [引用文檔](http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html)「重要UIImagePickerController類只支持縱向模式。」 – 2012-08-02 08:06:38