Tag: 方向

如何从webview播放video时设置横向方向

我有一个video链接的网页视图,该应用程序只是纵向,但我需要改变方向时,全屏video,并使用所有的屏幕。 谢谢你的帮助。

旋转呈现的视图并locking呈现视图控制器的方向

我正在研究只支持横向的iPad应用程序,我想让一些提供的视图控制器支持所有的方向而不改变呈现视图控制器的方向。 我支持Xcode设置中的所有方向,除了倒置。 我用来呈现视图控制器的代码 ViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"VC"]; vc.modalPresentationStyle = UIModalPresentationFormSheet; [self presentViewController:vc animated:YES completion:nil]; 我正在使用的代码允许呈现视图控制器的方向: – (UIInterfaceOrientationMask)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } – (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{ return YES; } 你pipe应用程序提供同样的function,同时播放video,任何想法如何工作? 任何帮助将不胜感激,谢谢。

iOS 7没有调用supportedInterfaceOrientations

我search了这个答案,但找不到解决我的问题的任何东西。 所以这里的问题是:我有一个自定义的UINavigationController,创build它时在rootViewController上调用supportedInterfaceOrientations方法(只支持肖像)。 但是当把另一个ViewController推入堆栈时,这个方法在被推送的ViewController上不会被调用(支持所有的倒置)。 我通过在viewDidLoad方法中调用[self supportedInterfaceOrientations]来解决它,但是我认为这不是解决问题的好方法。 我希望你能在这个问题上帮助我。 这是我在第二个viewController中实现的代码。 – (BOOL)shouldAutorotate { return YES; } – (NSUInteger)supportedInterfaceOrientations { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { [[[UIApplication sharedApplication] delegate] setGlobalOrientationMask:UIInterfaceOrientationMaskAllButUpsideDown]; return UIInterfaceOrientationMaskAllButUpsideDown; } else { [[[UIApplication sharedApplication] delegate] setGlobalOrientationMask:UIInterfaceOrientationMaskAll]; return UIInterfaceOrientationMaskAll; } } 我认为johnma的解决scheme应该可以适用于大多数应用程序,但在我的情况下,我认为有一个特殊的问题,但我现在自己解决(不知道它是否是一个好的,但它的工作原理)。 我实现了- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated在我的navigationController委托的- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated方法。 – (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController […]

自动旋转在iOS 7中不起作用,在iOS 6中工作正常

我有一个应用程序,只支持一些部分(照片库,video等)的横向方向,所有工作正常在iOS 6没有问题,但是,在iOS 7应用程序崩溃。 所以inheritance人我的问题: 启动应用程序并加载仅支持纵向的视图控制器的初始导航控制器 将视图控制器推到支持横向和纵向的堆栈上 旋转视图到风景 stream行视图控制器 应用程序崩溃 –> CRASH: **preferredInterfaceOrientationForPresentation must return a supported interface orientation!** 2013-11-06 10:18:06.220 ausopen-iphone-2014[57605:70b] Stack Trace: ( 0 CoreFoundation 0x03f665e4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x03ce38b6 objc_exception_throw + 44 2 CoreFoundation 0x03f663bb +[NSException raise:format:] + 139 3 UIKit 0x01366f1c -[UIViewController _preferredInterfaceOrientationForPresentationInWindow:fromInterfaceOrientation:] + 580 其他信息: 在我的info.plist中,我支持纵向和横向 在我的AppDelegate中,我实现了以下方法: – (NSUInteger)application:(UIApplication […]

允许一个视图支持多个方向而其他人不要iPhone

我有一个情况,我有多个视图通过UITabBarController控制。 其中一个视图是通过UINavigationController控制的。 应用程序应该只支持所有视图的肖像…除了一个单独的视图。 这个视图被推到导航控制器的堆栈上,并且应该允许纵向和横向。 我已经尝试了所有我能想到的解决scheme,但是,解决scheme无法正常工作,或者更糟是完全不可预知的。 有没有人以一种干净的方式解决这个问题?

更新到Xcode 7.0.1和项目现在有问题

所以我上传了我的Xcode 6.1版本到iTunes Connect,这个应用程序被批准了。 现在我试图更新应用程序,我更新到Xcode 7.0.1和Xcode是给我的问题说明: (对于我使用故事板和Objective-C的应用程序) 警告:除非应用程序需要全屏,否则必须支持所有界面方向。 警告:除非应用程序需要全屏,否则必须提供启动故事板或xib。 – (NSUInteger)supportedInterfaceOrientations { return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown); } iOS 9支持的新界面方向是什么?

使用其他旅行模式的Google地图方向XML或JSON

我试图获得除驾驶以外的其他行驶方式的指示,但是api似乎并不尊重dirflg参数。 http://maps.googleapis.com/maps/api/directions/json?origin=111%20Davisville%20Avenue,Toronto,ON&destination=469%20King%20Street%20West,%20Toronto,%20ON&sensor=false&dirflg=w 谁能告诉我什么是正确的url? 先谢谢你。

程序化界面方向更改不适用于iOS

所以,我有一个项目,当用户按下一个button时,我需要强制改变方向。 我已经在github上创build了一个示例应用程序来演示这个问题。 @interface DefaultViewController () { UIInterfaceOrientation _preferredOrientation; } 一些旋转处理位 – (BOOL)shouldAutorotate { return YES; } – (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return _preferredOrientation; } 和一个切换 – (IBAction)toggleButtonPressed:(id)sender { _preferredOrientation = UIInterfaceOrientationIsPortrait(_preferredOrientation) ? UIInterfaceOrientationLandscapeRight : UIInterfaceOrientationPortrait; [self forceOrientationChange]; } – (void)forceOrientationChange { UIViewController *vc = [[UIViewController alloc] init]; [self presentViewController:vc animated:NO completion:nil]; [UIView animateWithDuration:.3 animations:^{ [vc dismissViewControllerAnimated:NO completion:nil]; […]

iOS旋转video的每一帧

我需要旋转一个video,因为iPhone后置摄像头正在录制,就好像它总是在左侧风景一样。 我需要物理旋转video,因为设置方向不适用于所有浏览器(例如Chrome)。 所以我设置了一些代码来读取录制的video并在旋转后保存。 我使用AVAssetExportSession这似乎工作得很好,除了两个问题: – 导出的video在开始时有一些黑色的框架 – 一些video不会被导出。 是否有可能对这个问题有所了解? 谢谢! 码: AVAsset* asset = [AVURLAsset URLAssetWithURL: videoUrl options:nil]; AVMutableComposition *composition = [AVMutableComposition composition]; AVMutableCompositionTrack *compositionVideoTrack = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; AVMutableCompositionTrack *compositionAudioTrack = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; AVAssetTrack *videoTrack = [[asset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]; AVAssetTrack *audioTrack = [[asset tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0]; [compositionVideoTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, asset.duration) ofTrack:videoTrack atTime:kCMTimeZero error: &error]; [compositionVideoTrack […]

在视图中locking纵向? IOS 7

所以,我想locking我的主页的方向肖像,只有主页。 我正在使用标签栏控制器,所以初始视图是标签控制器,但首先出现的视图控制器是第一个选项卡,例如主页。 我想这样做,当用户去旋转设备,它不会旋转到横向在这个页面上。 但所有其他页面都可以旋转。 我已经search了四周,没有什么似乎是特定于iOS 7,而特定于iOS 7的不起作用… 请帮忙,谢谢! 下面的图片描述了我不希望发生的事情。