我試圖添加自定義後退按鈕導航欄上,但它沒有在下面的工作是我的代碼添加自定義後退按鈕導航欄上
-(void)addLeftButton
{
UIImage *buttonImage = [UIImage imageNamed:@"btn_back.png"];
UIButton *aButton = [UIButton buttonWithType:UIButtonTypeCustom];
[aButton setBackgroundImage:buttonImage forState:UIControlStateNormal];
aButton.frame = CGRectMake(0.0, 0.0, buttonImage.size.width, buttonImage.size.height);
UIBarButtonItem *aBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:aButton];
[aButton addTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.backBarButtonItem = aBarButtonItem;
}
請告訴什麼是錯,此代碼
這是左鍵不後退按鈕@ Developer.iOS –
它意味着你不希望把後退按鈕在導航的左側? –
日Thnx傢伙,它的工作 –