I want to draw multiple buttons on a UINavigationBar
. These will be either on right side or left side.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
Create a new UIToolbar in code and add your buttons to the toolbar. Then set self.navigationItem.rightBarButton to your newly created toolbar (note the example is without ARC so you may need to remove calls to release):
do it in your xib file and make properties or just variables in the header
and then connect it in the xib. Enjoy
I did one example in which I had two buttons ( i.e. Edit and +) on Right side of NaviagationBar.
1) You have to create one
NSMutableArray
(i.e. "buttons" in example) and addUIBarButtonItem
(i.e. bi1 and bi2 in example) to theNSMutableArray
(i.e. buttons).2) Add
NSMutableArray
(i.e. buttons in example) to toolbar(i.e.UIToolbar *tools
in example).3) Add toolbar to NavigationBar.
Here I'm giving you sample code that I used for Button as well as label. you can create button instead of label and image what i created. I hope it will help you
}
If any problem in understanding or else then plz inform me.