定义
#define BARBUTTON(TITLE, SELECTOR) [[[UIBarButtonItem alloc] initWithTitle:TITLE style:UIBarButtonItemStylePlain target:self action:SELECTOR] autorelease]
使用
self.navigationItem.leftBarButtonItem = BARBUTTON(@"Redo", @selector(redo));
本文介绍如何定义一个自定义UIBarButtonItem方法,并将其应用于iOS应用的导航栏中,通过实例演示了如何设置按钮的标题、样式及触发的动作。
定义
#define BARBUTTON(TITLE, SELECTOR) [[[UIBarButtonItem alloc] initWithTitle:TITLE style:UIBarButtonItemStylePlain target:self action:SELECTOR] autorelease]
使用
self.navigationItem.leftBarButtonItem = BARBUTTON(@"Redo", @selector(redo));
10万+
13万+

被折叠的 条评论
为什么被折叠?
