I tried setExpandTitleTextAppearance
, but it didn't work. I want to center the expanded title text.
There is an attribute expandedTitleGravity
that you can use with the CollapsingToolbarLayout to center the expanded title text. Add this to your CollapsingToolbarLayout:
app:expandedTitleGravity="bottom|center_horizontal"
In my use case, I set app:titleEnabled
to false, I didn't need it anyway. After that, my gravity was respected properly inside the Toolbar layout.
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