我这样设置 NavigationBar 的按钮:
UIBarButtonItem *addAcc = [[UIBarButtonItem alloc]
initWithTitle:@"Add"
style:UIBarButtonItemStylePlain
target:self
action:@selector(addNewAcc)];
UIBarButtonItem *delAcc = [[UIBarButtonItem alloc]
initWithTitle:@"Del"
style:UIBarButtonItemStylePlain
target:self
action:@selector(DeleteButtonAction)];
NSArray *arrBtns = [[NSArray alloc]initWithObjects:addAcc,delAcc, nil];
self.navigationItem.rightBarButtonItems = arrBtns;
这很好用,但在旋转设备或更改按钮后,它们会变得更长。我该如何解决这个问题?
问候
这是截图: 旋转前: http: //i.stack.imgur.com/9W3Hl.jpg 旋转后:http: //i.stack.imgur.com/M27Hx.jpg