Search code examples
androidxamarinandroid-collapsingtoolbarlayoutbutterknife

Android Collapsing Toolbar Subtitle


I'm trying to use this library to make a Collapsing Toolbar with a subtitle.
However, this library uses ButterKnife binding, which I'm not familiar with, and also I'm using Xamarin, which is different.
Can someone guide me how to use this library without needing to use databinding?

Example of Binding use in the library:

@Bind(R.id.header_view_title)
TextView title;

@Bind(R.id.header_view_sub_title)
TextView subTitle;

Solution

  • You can replace:

    @Bind(R.id.header_view_title)
    TextView title;
    

    with:

    TextView title = (TextView) findViewById(R.id.header_view_title);
    

    Also, remove ButterKnife.bind(this); from your lifecycle callback.