UIBarButtonItem *itemTransformView = [[UIBarButtonItem alloc] initWithCustomView:_header.transformView];
// 调整 leftBarButtonItem 在 iOS7 下面的位置
if(([[[UIDevice currentDevice] systemVersion] floatValue]>=7.0)){
UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
target:nil action:nil];
negativeSpacer.width = -12;
self.navigationItem.rightBarButtonItems = @[negativeSpacer, itemTransformView];
}else{
self.navigationItem.rightBarButtonItem = itemTransformView;
}
时间: 2024-09-15 11:38:11