iPhone: 3 Buttons in the Title Bar?

You must Login before you can answer or comment on any questions.

Hi,

I've got a sub page, which by default, has the "Previous Window" button pointing left. I want to keep that there, but I also want to add to other buttons as well. I'm familiar with

window.setLeftNavButton(button1);
window.setRightNavButton(burron2);
But the problem is that setLeftButton replaces the "Previous Window" left-pointing arrow button. Is there any other way to get buttons into the title bar w/o using those two commands?

Thanks!

3 Answers

Accepted Answer

Create a buttonBar with multiple buttons, then set that as the right nav button as shown in the kitchen sink example buttonbar.js around lines 66 - 79. Note that you could also set a button as the titleControl if you wanted a button to replace the title text. But IMHO a button bar would be more appropriate in most scenarios.

You could try navGroup.add(); but that would not have same Look. Another way would be hiding the navBar and adding toolbar, you would need to add the back Button by yourself.

Using 'native' bar leaves you with the to functions you mentioned alone.

Hi Casey,

I think I have the answer you are looking for.

You want to add several buttons in the Title or Navbar ?

This is what you should do:

create a View.

Add 2 buttons to that view.

Then put the view in the Navbar.

— answered 1 year ago by E B
answer permalink
2 Comments
  • " put the view in the Navbar"

    how do you do that?

    — commented 1 year ago by Casey Crookston

  • Just assign the view to the window's right nav button. It is essentially the same thing as my suggestion. Pretty much all UI objects are a subclass of a view. I was just suggesting a button bar could be an appropriate object type to use instead of a button. The Kitchen Sink even gives an example of it, which I provided as a link.

    — commented 1 year ago by Doug Handy

Your Answer

Think you can help? Login to answer this question!