隐藏顶部导航栏和底栏

时间:2016-09-23 06:10:41

标签: ios webkit

Remove the top navigation bar and bottom bar

您好,

我正在使用WEBKIT(STKWebKitViewController)来显示网址,我无法找到隐藏导航栏和底栏的方法。请让我知道解决方案。

由于

1 个答案:

答案 0 :(得分:2)

通过你的STKWebKitViewController有一个方法

self.navigationController.hidesBarsOnSwipe = YES;

您可以隐藏导航栏

[self.navController setNavigationBarHidden:YES];
// Hide it in the AppDelegate where you make your root view controller if using xib.

要使用点击隐藏工具栏,则必须为其维护一个bool

if(!tap){
        hideNav = NO;
        tap = 1;
    } else {
        hideNav = YES;
        tap = 0;
    }
    [self.navigationController setToolbarHidden:hideNav animated:YES];

OR simply use

[self.navigationController setToolbarHidden:YES animated:YES];