我要加载SFSafariViewController
位于选项卡内部,因此选项卡栏位于整个 Safari 视图的底部。
这可能吗?我尝试了这个但没有运气:
[self.tabBarController presentViewController:sfController animated:YES completion:nil];
Is it requiredSafari 视图是全屏吗?
我能够以编程方式实现这一目标。他们的关键是没有UITabBar
覆盖在你的上面UIViewController
是设置translucent
to NO
:
在你的 AppDelegate.m 中:
@import SafariServices;
// ...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UITabBarController *tabBarController = [[UITabBarController alloc] init];
tabBarController.tabBar.translucent = NO;
SFSafariViewController *firstVC = [[SFSafariViewController alloc] initWithURL:[NSURL URLWithString:@"http://stackoverflow.com"]];
firstVC.title = @"SFSafariViewController";
UIViewController *secondVC = [[UIViewController alloc] init];
secondVC.view.backgroundColor = [UIColor blueColor];
secondVC.title = @"Blue VC";
tabBarController.viewControllers = @[firstVC, secondVC];
self.window.rootViewController = tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)