我正在使用以下函数通过通知在我的UINavigationBar上加载一个右侧按钮,尽管我可以跟踪该按钮并验证它已分配,但它不会显示出来...有什么想法吗?
编辑4/6/2011,2:42 PM
所以,有趣的事情是...宽度总是报告为0.0...
编辑4/6/2011,2:42 PM
所以,有趣的事情是...宽度总是报告为0.0...
- (void)showRightBarButton:(id)sender
{
NSLog(@"Showing button");
UIBarButtonItem *button = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(showPI:)];
[button setTitle:@"This Button"];
self.navigationItem.rightBarButtonItem = button;
//[[self.navigationItem rightBarButtonItem] setWidth:50];
NSLog(@"Button width is %f.", self.navigationItem.rightBarButtonItem.width);
[button release];
}