开发者

iPhone Add Item/Row Button in Navigation Bar

开发者 https://www.devze.com 2023-01-29 05:52 出处:网络
Is there a s开发者_JS百科tandard way to implement a button like the one below in a navigation bar? If not I can, of course, just use an image or maybe a custom view but as it\'s used in quite a few ap

Is there a s开发者_JS百科tandard way to implement a button like the one below in a navigation bar? If not I can, of course, just use an image or maybe a custom view but as it's used in quite a few apps I thought there may be a method I'm missing.

iPhone Add Item/Row Button in Navigation Bar


UIBarButtonItem *barBtnItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(add:)];

self.navigationItem.rightBarButtonItem=barBtnItem;
        [barBtnItem release];

this code use for creating + button.


That's one of the standard UIBarButtonSystemItem system icons (UIBarButtonSystemItemAdd) - take a look at the initWithBarButtonSystemItem:target:action: method in the UIBarButtonItem Class Reference.

0

精彩评论

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