Android ActionBar MenuItem LowerCase

后端 未结 7 1329
孤独总比滥情好
孤独总比滥情好 2020-12-13 06:41

I want to make MenuItem title in the ActionBar to LowerCase.

my menu.xml

  

        
7条回答
  •  忘掉有多难
    2020-12-13 07:15

    I tried some of the other answers here but to no luck (I'm not using action bar sherlock). As mentioned in the comments, in the newer support libraries, the above solutions don't seem to work. To solve this issue, I added my own actionLayout to the Menu Items.

    
    

    Then in my code I did something like this.

    final MenuItem done = menu.findItem(R.id.done);
    
    done.setActionView(R.layout.menu_item_kingfisher_text_view);
    
    TextView doneTextView = (TextView) done.getActionView();
    

    Then you can do what you want with the text view and avoid the text being all caps. This is definitely not ideal, but if you need a workaround for this issue, this does work.

提交回复
热议问题