3

I want to add back button on NavBar in iOS, but I can't find back array image on systemItem. Is there any property of default back arrow image.

I tried SMF.UI.iOS.BarButtonType.cancel but it has a title says "Vazgeç" instad of back arrow image.

abalta
  • 1,204
  • 1
  • 12
  • 21
  • I don't think there's a default back arrow image, since it's a system button type AFAIK – Lior Pollak Jan 06 '15 at 22:42
  • I mean it's possible to add a custom back bar button, but do you really need to do this? If you're working with a navigation controller, you'll get a back button automatically. It's even possible to add custom behavior to the default button. Here are actually a lot of threads about this topic. – fr33g Jan 06 '15 at 22:43

2 Answers2

1

You should use Navigation Controller for that. Then the back button will appear automatically.

If you want to display only image, without text, put this code in the view controller that you came from.

UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
self.navigationItem.backBarButtonItem = backButton;
Senõr Ganso
  • 1,694
  • 16
  • 23
1

You must assign onSelected event of back item. Can you try this;

var leftItem = new SMF.UI.iOS.BarButtonItem({
                    systemItem : SMF.UI.iOS.BarButtonType.cancel,
                    onSelected : Pages.back()
                });
this.navigationItem.leftBarButtonItems = [leftItem];
Özer Özcan
  • 1,253
  • 16
  • 17