我有应用程序我希望导航栏上的按钮应该位于所需位置但它没有完成我找到了 rightBarButton 和 leftBarButton 的方法但我希望它位于导航栏的中心
UIButton *settingsView = [[UIButton alloc] initWithFrame:CGRectMake(0,0,40,40)];
[settingsView addTarget:self action:@selector(SettingsClicked) forControlEvents:UIControlEventTouchUpInside];
[settingsView setBackgroundImage:[UIImage imageNamed:@"login btn.png"] forState:UIControlStateNormal];
UIBarButtonItem *settingsButton = [[UIBarButtonItem alloc] initWithCustomView:settingsView];
[self.navigationItem setRightBarButtonItem:settingsButton];