Skip to content

Instantly share code, notes, and snippets.

@monsoir
Created December 1, 2016 16:39
Show Gist options
  • Save monsoir/0620cdc9a0235dd09512b24b7c59e507 to your computer and use it in GitHub Desktop.
Save monsoir/0620cdc9a0235dd09512b24b7c59e507 to your computer and use it in GitHub Desktop.
if(([[[UIDevice currentDevice] systemVersion] floatValue]>=7.0?20:0)){
UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem: UIBarButtonSystemItemFixedSpace target:nil action:nil];
negativeSpacer.width = -10;//这个数值可以根据情况自由变化
self.navigationItem.rightBarButtonItems = @[negativeSpacer,itemAdd, itemSearch];
} else {
self.navigationItem.rightBarButtonItems = @[itemAdd, itemSearch];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment