Replace the action bar's title with a spinner (drop down)

前端 未结 1 1718
旧时难觅i
旧时难觅i 2021-02-14 04:33

I am trying to display a spinner in the same position where the action bar\'s default title appear. I followed the instruction of the similar SO case here , so I managed to elim

1条回答
  •  -上瘾入骨i
    2021-02-14 05:02

    Action Views in the menu are always going to align to the right. If you want your Spinner to align left, it would be better to set it as a custom View on the ActionBar using the setCustomView() method. A custom View will align to the left by default, and will take the place of the title if that is hidden. Please note that this requires that you call setDisplayShowCustomEnabled(true) on the ActionBar.

    0 讨论(0)
提交回复
热议问题