DZNWebViewController icon indicating copy to clipboard operation
DZNWebViewController copied to clipboard

Hide title url

Open WenchaoD opened this issue 10 years ago • 12 comments

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?

WenchaoD avatar Feb 10 '15 03:02 WenchaoD

Hey there! What do you mean by weird?

dzenbot avatar Feb 10 '15 05:02 dzenbot

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

WenchaoD avatar Feb 10 '15 06:02 WenchaoD

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. :/

jyounus avatar Apr 19 '15 16:04 jyounus

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.

dzenbot avatar Apr 19 '15 16:04 dzenbot

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

nsvrana avatar Feb 01 '16 17:02 nsvrana

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

dzenbot avatar Feb 22 '16 10:02 dzenbot

Any solution?

hesyifei avatar Jul 04 '16 05:07 hesyifei

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! 😄

hesyifei avatar Jul 04 '16 06:07 hesyifei

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

dzenbot avatar Jul 06 '16 18:07 dzenbot

@dzenbot see 5e75217

hesyifei avatar Jul 07 '16 00:07 hesyifei

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

dzenbot avatar Jul 07 '16 00:07 dzenbot

Sure @dzenbot

WenchaoD avatar Jul 07 '16 02:07 WenchaoD