[TIMOB-1164] ability to add multiple buttons to navbar
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2012-01-04T11:05:22.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | buttons, ios, ipad, leftnavbutton, navbar, rightnavbutton |
Reporter | Sindre Sorhus |
Assignee | Neeraj Gupta |
Created | 2011-04-15T02:45:36.000+0000 |
Updated | 2017-03-22T22:56:21.000+0000 |
Description
Right now you can only add one button to each of leftNavButton and rightNavButton, this is ok for iPhone, but for iPad there should be possible to add multiple buttons to the navbar.
Can't you add a view?
Yes, but then I get just ordinary, non navbar, buttons. I want navbar buttons like those in the Mail app on iPad.
Use a button bar
I love you guys at appcelerator but this is not invalid
yes you could use a tabbed bar if you just wanted multiple buttons and didnt care what it looked like. But that is not what Mofie was asking for, nor is it at all a suitable alternative to nav buttons.
i believe what mofie is asking for (as am i now) is the ability to add multiple 'system' buttons to the NavBar locations. so that we are able to replicate the look and feel of native ipad apps.
for that matter, what if i wanted 2 tabbed bars in the top right, could i do that? no. so this ticket is valid.
Ta
Richie
Bump - I agree with RavenLife. I've been looking for ways to add more buttons to the navBar and the solution would be to allow a view to be added to either side and allow the button style to be like a native button.
Please reconsider this and open it back up.
Kai
RavenLife is correct. This is not invalid. Please reopen.
iPhone and iPad both have the restriction that you cannot have multiple buttons in a bar. You must design your own custom view and set it as the left/right navigation button. This bug is invalid.
That is correct, but the problem is that we can't use the system button style (with glow) using Ti.UI.createButton() and adding it to a view. There are ways to do this though, and a lot of apps do it: http://osmorphis.blogspot.com/2009/05/multiple-buttons-on-navigation-bar.html But we rely on what Titanium provides us with. Fortunately in iOS 5 this is [supported natively](http://developer.apple.com/library/ios/#documentation/uikit/reference/UINavigationItem_Class/Reference/UINavigationItem.html): See: leftBarButtonItems and rightBarButtonItems Either reopen this, or ask me to create a new issue.
We can't add iOS 5-specific features to the product yet, as that breaks backwards compatibility with iOS 4 devices, which still have a large market share. Taking advantage of iOS 5 features like this would require writing a lot of additional code to work with the appropriate devices. When we begin adding support for setting minimum app versions, it is more likely that iOS 5-specific features will be added.
This has been deprecated in favor of TIMOB-6975, which allows adding toolbars (which should also support system styled buttons) to the nav bar.
Brief update to this ticket; you may be able to use
Ti.UI.Window.toolbar
to style appropriately.I know this is an old ticket, but right now I'm looking for a way to achieve this. I tried the suggested workaround (using a toolbar) but it doesn't work unless the toolbar is added to a view and has a fixed width in pixel (
Ti.UI.SIZE
doesn't work) which is not very convenient. I can provide a complete test case for this if needed, but I think a better solution would be (as Sindre suggested) to useleftBarButtonItems
andrightBarButtonItems
properties. This would no longer breaks backward compatibility with iOS 4 because the latest release (3.1.1.GA) raised the minimum iOS SDK to 5.0. I think implementingleftBarButtonItems
andrightBarButtonItems
in Titanium would be nice and also much more elegant than the trick I mentioned above.To [~pdaigle] and everyone looking for the ability to add more than one item in the right nav area, we're pleased to announce this small yet useful module: https://github.com/smclab/TiNavItems Instead of an hack (toolbars and similar) that break horribly in iOS 7 we're using directly the iOS 5+ feature.
Closing ticket as "Won't Fix".