0

我正在尝试推送到另一个视图控制器,并且我的 barbuttonitems 都不会显示在我的导航栏上。这是我的代码:

- (void)viewDidLoad
{
    [super viewDidLoad];

    NSString *stringMoney1 = self.monier;
    NSString *stringMoney2 = self.monier2;

    NSString *appendedMoney = [stringMoney1 stringByAppendingString:stringMoney2];

    self.moneyText.text = [NSString stringWithFormat:@"%@", appendedMoney];

    self.moneyText.backgroundColor =[UIColor clearColor];
    self.moneyText.scrollEnabled = NO;
    self.moneyText.userInteractionEnabled = NO;

    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    self.navigationController.navigationBarHidden = NO;
    self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};
    self.navigationController.navigationBar.barTintColor = [UIColor redColor];
    self.navigationController.navigationBar.translucent = NO;
    self.title = @"INBOX";

    self.moneyLbl.font = [UIFont fontWithName:@"Outstanding" size:8];

}

它可能是我的 .xib 文件或我以前的视图控制器中的东西吗?

任何帮助将不胜感激!

4

1 回答 1

0

在使用 self.navigationController 推送 viewController 时,默认提供后退按钮。如果需要额外的导航栏按钮项目,我们可以添加它们。例如,

     UIBarButtonItem *backButton = [[UIBarButtonItem alloc]
                               initWithTitle:NSLocalizedString(@"Back", @"Back")
                               style:UIBarButtonItemStyleBordered
                               target:self
                               action:@selector(popViewController)];
self.navigationItem.leftBarButtonItem = backButton;
于 2013-10-26T06:29:44.817 回答