With the new Design Library, we're supposed to set the toolbar title on the CollapsingToolbarLayout
, not the Toolbar
itself(at least when using the collapsing toolbar). But setTitle()
only updates the title in the following specific circumstances:
1) When the CollapsingToolbarLayout
does not have a title yet
2) At the moment the CollapsingToolbarLayout
becomes fully collapsed
3) At the moment the CollapsingToolbarLayout
starts to expand
What I'm actually trying to do is make the title become an EditText
when fully expanded, allowing the user to give his/her character a name, which then displays as the title. I've tried to force the issue by calling
invalidate()
or requestLayout()
, as well as both of those methods on CollapsingToolbarLayout
's children. No effect.
Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…