-1
iOSの11ナビゲーションの問題は、私は、ナビゲーションバー
- これは私の現在のコードである上、左、右とタイトルビューを設定する必要があります。
だから、これはですが、今私はそれで問題がある:
btnMenu = [UIButton buttonWithType:UIButtonTypeSystem]; [btnMenu setFrame:CGRectMake(0, 0, 25, 25)]; [btnMenu setTintColor:[UIColor blackColor]]; [btnMenu setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft]; [btnMenu setImage:[UIImage imageNamed:@"menu"] forState:UIControlStateNormal]; [btnMenu addTarget:self action:@selector(clickOnMenu:) forControlEvents:UIControlEventTouchUpInside]; leftBarButton2 = [[UIBarButtonItem alloc] initWithCustomView:btnMenu]; [arrLeftBarButton addObject:leftBarButton2]; self.navigationItem.leftBarButtonItems = [NSArray arrayWithArray:arrLeftBarButton]; [viewTitle addSubview:search]; [viewTitle addSubview:btnSelectSearch]; viewTitle.translatesAutoresizingMaskIntoConstraints = false; self.navigationItem.titleView = viewTitle; BBBadgeBarButtonItem *badgeNotify = [[BBBadgeBarButtonItem alloc] initWithCustomUIButton:btnNotify]; badgeNotify.badgeBGColor = [UIColor whiteColor]; badgeNotify.badgeTextColor = [UIColor blackColor]; badgeNotify.badgeValue = @"0"; self.navigationItem.rightBarButtonItem = badgeNotify;
が見るこのhttps://でのstackoverflow .com/questions/44442573/navigation-bar-rightbaritem-image-button-bug-ios-11 –
それはナビゲーションバーの推奨サイズではない画像を設定しているようです。ヒューマンインタフェースのガイドラインを見てください:https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/custom-icons/ PS:コードを投稿できる方が簡単になります。実際の問題を指摘することができるように – Rishi