我正在摔跤这个问题。 我需要我的应用程序的肖像视图和风景视图。现在,当我创建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