tags:

views:

97

answers:

2

Hello everyone

In one project, I hope to change UIBarButtonItem and style in runtime

editBarItemButton links to a UIBarButtonItem which original status are

style:UIBarButtonItemStyleBordered title:Edit

if I press the bar item button, it will execute the codes below:

[editBarItemButton setStyle: UIBarButtonItemStyleDone];
[editTarBarItemButton setTitle:@"Done"  ];

but neither the style nor title has changed.

Welcome any comment

Thanks interdev

A: 

You cannot change the style of a UIBarButtonItem after it has already been initialized.

Jacob Relkin
A: 

Just remove the old buttons Create new buttons with the styles you want Set the new buttons

sujee