【发布时间】:2011-03-12 05:49:29
【问题描述】:
如标题所述,我该如何实现这样的功能?
我正在使用下面的代码(在我的 viewDidLoad 中)来获取主视图的导航控制器上的按钮。
UIButton* infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
[infoButton addTarget:self action:@selector(viewWillAppear:) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:infoButton];
不确定如何在所有视图中显示它。
【问题讨论】:
标签: iphone xcode uiview uinavigationcontroller uibutton