- (void)createNavigationLeftBarButtonItemWithCustomView:(UIButton *)button
{
UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
if ([[[[UIDevice currentDevice] systemVersion] substringToIndex:1] intValue]>=7) {
UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
negativeSpacer.width = -16;
self.navigationItem.leftBarButtonItems = @[negativeSpacer, buttonItem];
}else{
self.navigationItem.leftBarButtonItem = buttonItem;
}
}
其實(shí)測試了下左側(cè)的item里旁邊應(yīng)該是16px漓糙,右側(cè)是12px铣缠,可以去試試噢!
http://www.tuicool.com/articles/3Ufema