ninjinkun / NJKWebViewProgress

UIWebView progress interface
MIT License
3.89k stars 594 forks source link

Why the web view is below the navigation bar if we don't use storyboard? #33

Open chenweiyj opened 10 years ago

chenweiyj commented 10 years ago

The demo app which use storyboard to create the UIWebView runs fine as follows.

right

However, if I change the UIWebView to be created programmatically, some part of the view is below the navigation bar which cannot be seen. Following image shows the result.

wrong

Following code shows how the UIWebView is created.

@implementation ViewController
{
//    IBOutlet __weak UIWebView *_webView;
    UIWebView *_webView;
    NJKWebViewProgressView *_progressView;
    NJKWebViewProgress *_progressProxy;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    _webView = [[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    [self.view addSubview:_webView];
    ......
}
BrandDev commented 9 years ago

how did you implement the NJKWebViewProgressView into the UIWebView programmatically? I can't seem to implement it into my project or Navigation Bar. Can you help?