草庐IT

ios - 横向模式下的 UIImagePickerViewController

我正在开发完全处于横向模式的应用程序。在其中一个View中,我需要使用叠加View打开相机(UIImagePickerController)。但是当我点击按钮打开相机时,它会因这个问题而崩溃,即原因:'Supportedorientationshasnocommonorientationwiththeapplication,andshouldAutorotateisreturningYES'我也把这一行放在viewcontroller中但没有效果。-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)

ios - Monotouch - 以横向创建的 View 以纵向显示

我创建了一个ViewController,并在XCode4.2(InterfaceBuilder)中将View的方向设置为Landscape。但是,当我添加View时,View以纵向显示。我已经覆盖了所有ViewController中的ShouldAutorotateToInterfaceOrientation以返回true,并且我尝试使用以下代码手动旋转View:this.View.Transform.Rotate(3.14f*.5f);我还尝试将框架设置为横向框架(即480X320),尽管View的框架已经正确设置。澄清一下,我的绝大多数观点都在肖像中。我想以横向加载横向View,

ios - 2个纵向和横向 Storyboard

有没有可能创建两个Storyboard,一个纵向和一个横向,然后根据设备方向访问它们?像这样的东西:-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{if(interfaceOrientation==UIInterfaceOrientationLandscapeLeft||interfaceOrientation==UIInterfaceOrientationLandscapeRight){self.storyboard=(oneofthestoryboa

iOS:如何交换横向 Xs 和 Ys

我的应用将只显示横向。我在宽度、高度、x和y变量方面存在重大问题。有没有一种方法可以交换所有宽度、高度、x和y值,这样我就不必反转应用程序中的所有坐标?(即(x,y)必须变成(y,x)并且something.width必须是something.height。)这是我的问题的一个具体例子:-(void)touchesEnded:(NSSet*)toucheswithEvent:(UIEvent*)event{UITouch*touch=[[eventallTouches]anyObject];CGPointtouchPoint=[touchlocationInView:unitArea]

iphone - 当用户旋转到横向时全屏播放视频,然后在视频停止时以编程方式旋转回来

我有一个要求,其中包含视频的界面仅为纵向,但当用户旋转为横向时,视频会进入全屏并开始播放,然后当视频播放结束或用户点击完成时,视频退出全屏,界面仍为纵向。我尝试使用shouldAutorotateToInterfaceOrientation:方法启动视频。但我无法让屏幕再次旋转回来。我决定改为使用shouldAutorotateToInterfaceOrientation:并创建我自己的ViewController来仅处理视频并使用-[UIViewsetTransform:]来旋转视频,但旋转仅在我禁用全屏时才有效这是我的部分代码-(void)deviceOrientationDidC

objective-c - 如何使 MPMoviePlayerViewController 以横向模式启动但仍允许更改方向

这里有很多问题涉及将电影播放锁定为横向模式,或支持使用MPMoviePlayerViewController或MPMoviePlayerController横向播放电影。我已经拥有横向/纵向功能,而且我不想将播放锁定为任何一种模式。我所拥有的是按照文档建议使用MPMoviePlayerViewController的代码,本质上:MPMoviePlayerViewController*movieViewController=[[MPMoviePlayerViewControlleralloc]initWithContentURL:url];[parentViewControllerpre

c# - iOS 上的 MonoGame 和 MonoTouch - 横向

我们正在使用MonoGame为iOS和WindowsPhone7(然后最终是Android)开发。我们的游戏只能横向运行。如果在Windows上的WP7模拟器中运行,我们的图形设备设置如下,在我们游戏的Initialize()中:graphics=newGraphicsManager(this);graphics.PreferredBackBufferWidth=480;graphics.PreferredBackBufferHeight=320;graphics.SupportedOrientations=DisplayOrientation.LandscapeLeft|Displa

iphone - 如何在横向模式而不是纵向模式下捕捉 avfoundation

在这里需要帮助,已经修复了几个小时但无济于事。我想捕捉图像并显示它的预览,在AVCaptureVideoPreviewLayer中,它以横向模式显示。然而,当我抓取图像时,它显示为纵向模式。我不知道为什么,我希望有人能帮助我:)感谢阅读。实时取景时当捕获并显示在uiimageview中时-(void)addStillImageOutput{[selfsetStillImageOutput:[[AVCaptureStillImageOutputalloc]init]];NSDictionary*outputSettings=[[NSDictionaryalloc]initWithObje

ios - 将设备放在表面上后,是否可以确定应用程序 UI 是否处于横向?

如果用户在横屏模式下手持iPad,我会确定键盘的帧偏移。我发现如果我在横向模式下添加内容然后将iPad平放在表面上,我将无法正确设置偏移量。我正在使用下面的代码来设置偏移量:if([[UIDevicecurrentDevice]orientation]==UIDeviceOrientationLandscapeLeft||[[UIDevicecurrentDevice]orientation]==UIDeviceOrientationLandscapeRight){tableView.frame=CGRectMake(0,0,tableView.frame.size.width,tab

ios - 以编程方式将方向转换为横向的代码?

在FirstViewController中有一个按钮。按下后,有一个转到SecondViewController的模态转场。FirstViewController是Portrait,SecondViewController是Landscape。在Storyboard文件中,我将SecondVC设置为横向,但iOS模拟器不会自动更改它的方向。谁能帮我找到自动将SecondViewController从Portait变为Landscape的代码?viewDidLoadSecondVC中的语句:-(void)viewDidAppear:(BOOL)animated{UIDeviceOrien