dzenbot / DZNWebViewController

A simple web browser for iPhone & iPad with similar features than Safari's
https://www.cocoacontrols.com/controls/dznwebviewcontroller
MIT License
1.06k stars 181 forks source link

Hide title url #19

Open WenchaoD opened 9 years ago

WenchaoD commented 9 years ago

Hey, @dzenbot I found your webViewController is really helpful, especiall the ProgressView part. But in some case, the url in the titleView might appears a bit wierd. Maybe we can add a flag to hide it?

dzenbot commented 9 years ago

Hey there! What do you mean by weird?

WenchaoD commented 9 years ago

For example, sometimes we want the url to be secret to protect some potential threat(it can't indeed, but better than do nothing).

jyounus commented 9 years ago

I just came across a "weird" behaviour with the title bar. The initial URL I load is for a blog post with a relatively big title. Everything is fine. However if I now press on a link to go to the homepage of that blog, the URL and title are relatively small (character count wise). The problem is, the frame of the label doesn't seem to position the x coordinate properly. It's not centred, it simply has the same x value as the big title/url was.

I tried to fix it by manually working out the final label frame size in the setTitle method but no luck. :/

dzenbot commented 9 years ago

This looks like it's another issue, not related to @f33chobits's feature request. Please open a new issue, and submit a screenshot to better understand.

nsvrana commented 8 years ago

I second the feature request to hide the title/url bar but leave the navigation bar.

dzenbot commented 8 years ago

This should be pretty easy to implement. Give it a try guys! 😉

hesyifei commented 8 years ago

Any solution?

hesyifei commented 8 years ago

Found a solution to display title only :)

First set showPageTitleAndURL to false

let webViewController = BeaconWebViewController(URL: loadUrl)
webViewController.showPageTitleAndURL = false
webViewController..........

Then in class BeaconWebViewController: DZNWebViewController, override didFinishNavigation

override func webView(webView: WKWebView, didFinishNavigation navigation: WKNavigation!) {
    self.title = self.webView.title
}

Done! 😄

dzenbot commented 8 years ago

Can anyone implement this tweak and submit a PR pls? I'm really short of time lately.

hesyifei commented 8 years ago

@dzenbot see 5e75217

dzenbot commented 8 years ago

This has been addressed by @eflyjason in https://github.com/dzenbot/DZNWebViewController/pull/52 Mind having a look @WenchaoD?

WenchaoD commented 8 years ago

Sure @dzenbot