[英]iOS Storyboard, trying to add bar button item as back button not appearing
隨即出現該按鈕,您可以在屏幕的左下方看到項目按鈕。
為了創建一個自定義的后退按鈕,我將在您的View Controller中嵌入一個Navigation Controller。 然后,如果要使用帶有自定義圖像的自定義后退按鈕,則可以在.m文件中執行以下操作。
- (void)viewDidLoad
{
UIBarButtonItem *addCustomButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"YourImage.png"] style:UIBarButtonItemStylePlain target:self action:@selector(yourSelector:)];
self.navigationItem.leftBarButtonItem = @[addCustomButton];
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.