繁体   English   中英

导航栏将不显示项目

[英]Navigation Bar won't show items

我正在尝试推送到另一个视图控制器,并且我的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文件中或以前的视图控制器中的内容吗?

任何帮助将不胜感激!

使用self.navigationController推送viewController时,默认情况下会提供一个后退按钮。 如果需要其他导航栏按钮项,我们可以添加它们。 例如,

     UIBarButtonItem *backButton = [[UIBarButtonItem alloc]
                               initWithTitle:NSLocalizedString(@"Back", @"Back")
                               style:UIBarButtonItemStyleBordered
                               target:self
                               action:@selector(popViewController)];
self.navigationItem.leftBarButtonItem = backButton;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM