Is there an existing API for this kind o开发者_开发知识库f separated controls for the UINavigationbar seen in Mail.app? More specifically this up and down arrows shown in the picture.
Note that you can create UIBarButtonItem
with any custom view you want. So you can create it with UISegmentedControl as well - it is what's likely used in your example. Workflow should be something like:
- Create momentary (
momentary
property set to yes) UISegmentedControl with 2 segments - Assign an image to each of them (using
setImage:forSegmentAtIndex:
method). Then - Create
UIBarButtonItem
initialized with this UISegmentedControl as a custom view (usinginitWithCustomView:
method). - Add your UIBarButtonItem as a left or right BarButtonItem to the UINavigationItem
精彩评论