How I can multiline the expanded title of CollapsingToolbarLayout?

前端 未结 5 1394
暖寄归人
暖寄归人 2021-02-03 20:13

My problem is the next. I would use relatively large texts as CollapsingToolbarLayout title so I need to show it as multiline mode. When I try to change text appearance through

5条回答
  •  忘了有多久
    2021-02-03 20:41

    A simpler approach would be to add a custom layout added to the CollapsingToolbar and pin it.

    Some of the notes to take care:

    • The the toolbar should have the height of your collapsed content, this can be done by code or at the XML.
    • The elements you want to hide must be BEFORE the toolbar definition in the layout XML file
    • The elements you want to remain visible must be AFTER the toolbar definition in the layout XML file.

    Checkout the full code here. The final result is:

提交回复
热议问题