UIBarButton Deprecated in iOS 8.0

After changing the deployment target from 7.1 to 8.2, I just got a warning that the UIBarButton is out of date.

Here is the code I'm using:

UIToolbar* numberToolbar = [[UIToolbar alloc]initWithFrame:CGRectMake(0, 0, 320, 50)]; numberToolbar.items = [NSArray arrayWithObjects: [[UIBarButtonItem alloc]initWithTitle:@"Done" style:UIBarButtonItemStyleBordered target:self action:@selector(nextButton)], [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil], nil]; self.numberOfGuestsTextField.inputAccessoryView = numberToolbar; 

Is there anything I can use instead of UIBarButtonItem

error

+5
source share
1 answer

UIBarButtonItem not outdated - there is a UIBarButtonItemStyleBordered . Just use UIBarButtonItemStylePlain or UIBarButtonItemStyleDone .

As in iOS 7, the style of the buttons on the panel has changed to a flatter form. This is why UIBarButtonItemStyleBordered no longer available - it just looks like a UIBarButtonItemStylePlain button. With UIBarButtonItemStyleDone text will be bold rather than regular.

+14
source

All Articles