如何在CMFCCaptionBar添加多个按钮

2024年11月18日 14:00
有1个网友回答
网友(1):

Mads Mobæk:给UINavigationBar添加按钮的示例代码   12345678 UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:nil action:nil];UINavigationItem *item = [[UINavigationItem alloc] initWithTitle:@"Title"];item.rightBarButtonItem = rightButton;item.hidesBackButton = YES;[bar pushNavigationItem:item animated:NO];[rightButton release];[item release];   但是通常你得有一个Navigation Controller,使你能够写如下代码:   1234 UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:nil action:nil];self.navigationItem.ri...