I drag a Round Rect Button to the position of the right Bar Button Item, and set an image to the Round Rect Button. All works well, except the warning "Plain Style unsupported in a Navigation Item". Even if i select the style of the Bar Button Item to "Bordered", warning still be there. What's the matter with Xcode 4.2? Thanks in advance!
Ps. I customized many Bar Button Items with Round Rect Button, some times Xcode 4.2 shows only one warning on a Bar Button Item, some times shows warnings on all Bar Button Items.
In case you click on the warning and you don't go to the offending navigation item do the following. (visual representation of Hunter's answer with safer method from comments added in)
In the file browser right click on the storyboard and select
Open As Source Code
In the source code page search for "plain", and find the one attached to a Navigation Item.
To get the name of the View, put "scene" in the search bar and click the back search arrow to search for the first instance on that tag above the
navigationItem
Here is the name of your Scene, you can now change your Storyboard view back to
Interface Builder - Storyboard
with the right click method described above, and then go to select the Scene in the scene menu, and the Bar Item inside it.Go to the Attributes inspector and change the style from
Plain
toBordered
In my case it was an image of a back arrow, which was set to "Plain".
The error message appears to refer to all the items in the navigation bar.
After you are sure that you have all your bar buttons in the storyboard set to anything but plain, make sure you do a git commit and delete derived data. I spent forever trying to figure out why the problem wasn't fixing itself, and deleting the derived data folder fixed it for me.
In the navigation bar try using UIBarButtonItem instead of Round rect button and set an Image for it .
backBarButtonItem
leftBarButtonItem
andrightBarButtonItem
areUINavigationItem
objects. There is nostyle
property inUINavigationItem
so this is the reason of the warning. You should set the barButtons programatically:iOS 4:
For iOS 5+:
Read the "Customizing Appearance" section of UIBarButtonItem reference.
If you are using storyboard then click the warning and it should take you to the offending navigation item (I had two for the problem, one took me there the other did not) - change the style and clean the project.