CollapsingToolbarLayout without title animation

泪湿孤枕 提交于 2021-01-27 15:07:53

问题


I am working with CollapsingToolbarLayout. I don't know any methods to pin title in Toolbar.

Is there any simple way to achieve this?


回答1:


This solution works for me.

<android.support.design.widget.CollapsingToolbarLayout
        app:titleEnabled="false"
        ...
>



回答2:


You have to set its title manually in code.

CollapsingToolbarLayout collapsingToolbar =
              (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
      collapsingToolbar.setTitle("Title");


来源:https://stackoverflow.com/questions/32051529/collapsingtoolbarlayout-without-title-animation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!