开发者

Detect and handle, or override, clicks on a navigation bar

I have an app where I've pushed two items onto the navigation bar. The top item, which ends up as a 'back' button, should have the function to jump all the way back to the start page, which is a list of web news. The other one simply displays a logo. The boss wants a navigation bar look and feel but with a simple function, so the user can click around the news site, but always be able to jump to the news list page with just the one click.

Is the only option to create a fixed navbar with two items in IB, so that I can connect an outlet to the click开发者_开发技巧able item - or is there some way to intercept clicks to the navbar to make a requestURL? touchesBegan or touchUpInside would be fine, but I've found no way of implementing that so far.

It's okay if the whole navbar is clickable, I just need some hint how to make it happen. Add a transparent UIlabel on top and detect clicks for that, maybe?

A bonus would be to hide the item in the 'back' position without popping it from the stack.


Answer not needed anymore. I think it's just setting backBarButton to your own I've found no way to just change the title and target. Closing this. My solution back then was to make it a Toolbar, worked okay.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜