由於某些原因,導航欄中的右側按鈕距離右側爲16px。我想使邊距更小。什麼是正確的方法來做到這一點?iOS7中的navigationItem.rightBarButtonItem保證金
self.btnDone = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *btnImgDone = [UIImage imageNamed:@"btn_small_default.png"];
self.btnDone.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:15.0];
[self.btnDone setTitle:@"Done" forState:UIControlStateNormal];
[self.btnDone setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[self.btnDone setTitleShadowColor:[UIColor colorWithWhite:0 alpha:.2f] forState:UIControlStateNormal];
self.btnDone.titleLabel.shadowOffset = (CGSize){0,-1};
[self.btnDone setBackgroundImage:btnImgDone forState:UIControlStateNormal];
[self.btnDone setBackgroundImage:[UIImage imageNamed:@"btn_small_active.png"] forState:UIControlStateHighlighted];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.btnDone];
您在此期間是否找到答案? –