2
UIButton *addButton = [UIButton buttonWithType:UIButtonTypeCustom];
[addButton setImage:[UIImage imageNamed:@"addButton.png"] forState:UIControlStateNormal];
[addButton addTarget:self action:@selector(addSubProperty:) forControlEvents:UIControlEventTouchUpInside];
[addButton setFrame:CGRectMake(0, 0,51,44)];
UIBarButtonItem *firstBarButton = [[UIBarButtonItem alloc] initWithCustomView:addButton];
UIButton *deleteButton = [UIButton buttonWithType:UIButtonTypeCustom];
[deleteButton setImage:[UIImage imageNamed:@"deleteButton.png"] forState:UIControlStateNormal];
[deleteButton addTarget:self action:@selector(deleteProperty:) forControlEvents:UIControlEventTouchUpInside];
[deleteButton setFrame:CGRectMake(0, 0,50,44)];
UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
[negativeSpacer setWidth:-10];
UIBarButtonItem *secondBarButton = [[UIBarButtonItem alloc]initWithCustomView:deleteButton];
NSArray *navBtnArr = [[NSArray alloc] initWithObjects:negativeSpacer,firstBarButton,secondBarButton, nil];
self.navigationItem.rightBarButtonItems = navBtnArr;
如何減少UINavigationBar IOS 7中UIBarButton項之間的填充?
在此之後我得到這個結果,因爲你們可以看到我所做的能夠管理移動我的第一barbutton離開BYT是negativeSpacer但我DONOT知道如何減少這兩個鍵之間的空間。
而通過這樣做我的背也消失了任何想法將真正讚賞。
此鏈接對您有用 http://stackoverflow.com/questions/18897470/ios7-excessive-navigationbar-button-padding –