OGeek|极客世界-中国程序员成长平台

标题: ios - 使 SFSafariViewController 随设备旋转以匹配方向 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 15:07
标题: ios - 使 SFSafariViewController 随设备旋转以匹配方向

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

-(BOOL)textViewUITextView *)textView shouldInteractWithURLNSURL *)URL inRangeNSRange)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;
}



Best Answer-推荐答案


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

关于ios - 使 SFSafariViewController 随设备旋转以匹配方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35823942/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4