簡體   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