I'm currently setting the ActionBar
subtitle on certain pages, but on some pages i don't want to have a subtitle.
I can simply set the text of the subtitle to nothing, but this just removes the text. It still occupies the subtitle space and thus pushes the title up. It can be hard to explain, so i illustrated with a picture:
1) This show the ActionBar
with no subtitle set, which is how i want to be able to set it.
2 This shows the ActionBar with a subtitle set, which is how i want to show it on some pages.
3) And finally, this is how the ActionBar
looks after i set a subtitle and try to remove it.
As you can see, the title has been pushed up and the subtitle is not gone, it's just not showing anything.
I hope someone can help me out with this, i've tried googling the problem, i've digged through the official android website to find a getActionBar().ResetSubtitle()
or similar, but so far i've come up empty handed.
Call ActionBar.setSubtitle(null)
, this will change the visibility of the subtitle TextView
to View.GONE
.
Source
ActionBarView.setSubtitle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With