我正在摔跤這個問題。 我需要我的應用程序的肖像視圖和風景視圖。現在,當我創建2個按鈕來顯示縱向視圖和橫向視圖(由shouldAutorotateToInterfaceOrientation強制)時,它們顯示得很好。但是當我從imagepicker的結果代碼中調用視圖時,portraitview可以正常工作,但橫向視圖會像這樣返回。 http://bit.ly/bfbobc。iPhone視圖顯示錯誤的方向
所以,只要說清楚:nob已經轉動90度,imageviewcontrol只顯示一半(右邊的部分是屏幕外)...但iPhone並未強制進入橫向模式...
有人可以請解釋我這裏發生了什麼事情或我如何實現這一目標!歡迎任何幫助!
這就是我使用imagepickercontroller結果代碼調用視圖的方式。
` - (無效)imagePickerController:(的UIImagePickerController *)vcImagePicker didFinishPickingMediaWithInfo:(的NSDictionary *)信息{ 的NSLog(@ 「的照片拍攝/選擇,現在我們需要決定哪個視圖來呈現」);
[vcImagePicker dismissModalViewControllerAnimated:YES];
UIImage *chosenPicture = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
if (chosenPicture.size.width > chosenPicture.size.height) {
NSLog(@"pic is in landscape");
EditLandscapeScreen *vcEditLandscapeScreen = [[EditLandscapeScreen alloc] initWithNibName:@"EditLandscapeScreen" bundle:nil];
vcEditLandscapeScreen.ChosenImage = chosenPicture;
[self.view addSubview:vcEditLandscapeScreen.view];
[vcEditLandscapeScreen release];
}
else {
NSLog(@"pic is in portrait");
EditPortraitScreen *vcEditPortraitScreen = [[EditPortraitScreen alloc] initWithNibName:@"EditPortraitScreen" bundle:nil];
vcEditPortraitScreen.ChosenImage = chosenPicture;
[self.view addSubview:vcEditPortraitScreen.view];
[vcEditPortraitScreen release];
}
}`
我得到你要去的地方,但我想強制在子視圖上的風景,而不僅僅是提供景觀的可能性。 我強制這個使用'shouldAutorotateToInterfaceOrientation'並且左右爲landscapemodes返回YES,但是當我調用子視圖時,這個'強制'事情不起作用... 對此的任何想法?不管怎麼說,還是要謝謝你! – Martijn 2010-07-28 08:44:05