0

I'm implementing filtering functionality for list. I'm using spinner to select filter. I'm able to show it at ActionBar. However it's right aligned, and I couldn't pull it left in place of title. (Using Support Lib)

I tried to add width, remove title etc, but coldn't make it. It currently looks like this.

I want this;

enter image description here

Any idea how do we implement it?

Thank you.

Mohamed
  • 1,251
  • 3
  • 15
  • 36

2 Answers2

0

Try AppCompatActivity.getSupportActionBar().setTitle("")

Or use NoActionBar theme and add custom Toolbar with drop-down menu to your layout.

  • I tried removing title, however It doesn't affect place of MenuItems. I have app wide theme and action bar. So, I really can't change it. – Mohamed Apr 12 '17 at 17:49
  • Tried but 'actionBar.setNavigationMode' deprecated. Thanks for the answer. – Mohamed Apr 12 '17 at 18:23
0

You can also use this getSupportActionBar.setDisplayShowTitleEnabled(false).

Muhib Pirani
  • 765
  • 1
  • 6
  • 15
  • I did it, however It doesn't affect place of MenuItems. – Mohamed Apr 12 '17 at 17:46
  • You'll have to create custom toolbar and you can also refer this http://stackoverflow.com/questions/29807744/how-can-i-align-android-toolbar-menu-icons-to-the-left-like-in-google-maps-app – Muhib Pirani Apr 12 '17 at 17:52