I am trying to use the new api's from google, specifically the action bar.
When the build was set at api 10, if I pressed the menu button, I got nice looking menu options, each with a picture and icon. When using api 14, No matter what I try, it always puts the icon in the action bar with NO text. I have tried everything I can think of. I gave it the "with text" property, changed the text to a single character (in case it was a room issue), but nothing.
I have seen this done before, even in the developer guide at android.developer, but I can't seem to find an answer as to HOW to get it to show up.
Here's another option, based roughly on dgmltn's. The advantages:
I've assumed you're using ActionBarSherlock in this example. First, create the view layout you want. This one is based on ActionBarSherlock's. All I changed was swapping the image/view over, reducing the shared margin/padding to 0 so they are closer, and resolving all the ABS styles.
Then create the corresponding
View
class. You may want to copyCapitalizingButton
if you are worried about using internal things. Oh, also I never fixed the minimum width stuff. Don't think it really matters though.Ok now you're ready to use it. In your menu items that you want to have text, you do the same as what dgmltn said:
And finally, just add this code to your activity/fragment:
And that's it!