0
der Code in iOS 10 oder früheriOS 11 - Wie ändere ich die Position von rightBarButtonItems?
arbeitenUIButton *btn1 = [UIButton buttonWithType:UIButtonTypeCustom];
[btn1 setTitle:@"yyyyy" forState:UIControlStateNormal];
[btn1 setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
[btn1 sizeToFit];
UIBarButtonItem *item1 = [[UIBarButtonItem alloc] initWithCustomView:btn1];
UIBarButtonItem *fixed = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemFixedSpace target:nil action:nil];
fixed.width = -22;
self.navigationItem.rightBarButtonItems = @[fixed, item1];
wenn ich möchte die gleiche Sache in iOS 11, zu tun, was ich kann fo es tun?
Was 10 iOS tun Sie im iPhone 7 Plus-sehen zu laufen? Und warum ist die Breite negativ? – rmaddy
Mögliches Duplikat von [Negativer Platzhalter für UIBarButtonItem in der Navigationsleiste unter iOS 11] (https://stackoverflow.com/questions/45544961/negative-spacer-for-uibarbuttonitem-in-navigation-bar-on-ios-11) – pckill
@rmaddy, weil der Code 'fixed.width = -22;' – CoderYL