How to set subTitle to CollapsingToolbarLayout android

I need to set Title and SubTitle in my application. But in a new design library using CollapsingToolbarLayout it is possible to set the title and scrolling with the image works fine. How do I set the SubTitle to CollapsingToolbarLayout?

+3


source to share


1 answer


We can set the Title and subtitles for the toolbar programmatically as follows:



    Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar);
    toolbar.setTitle(getString(R.string.history));
    toolbar.setSubtitle(getString(R.string.month));

      

0


source







All Articles