【问题标题】:Make SFSafariViewController rotate with device to match orientation使 SFSafariViewController 随设备旋转以匹配方向
【发布时间】:2016-03-06 06:35:22
【问题描述】:

我正在从 tableVC 中创建一个 SFSafariViewController 的实例。当 SafariVC 打开时,旋转设备时它的方向不会改变(纵向到横向,反之亦然)。有没有快速解决这个问题?我尝试在 SafariVC 上使用一些布局锚点,这导致了崩溃。代码如下:

-(BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange {
    SFSafariViewController *sfvc = [[SFSafariViewController alloc]initWithURL:URL entersReaderIfAvailable:YES];
    [sfvc setModalPresentationStyle:UIModalTransitionStylePartialCurl];
    [self presentViewController:sfvc animated:YES completion:nil];
    [self.tabBarController.tabBar setHidden:YES];
    return NO;
}

【问题讨论】:

    标签: ios objective-c sfsafariviewcontroller


    【解决方案1】:

    也许这对您来说太晚了,但您是否只使用模拟器进行测试? 我遇到了同样的问题,但它在设备上正常工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-17
      • 1970-01-01
      • 1970-01-01
      • 2023-04-10
      • 2012-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多