search

Home  >  Q&A  >  body text

Android ButterKnife绑定include布局失败

天蓬老师天蓬老师2772 days ago814

reply all(3)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 16:52:26

    Try filling in the id for Toolbar

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 16:52:26

    You don’t need merge in this case, just use Toolbar directly as the root element of layout_toolbar.xml

    reply
    0
  • 阿神

    阿神2017-04-17 16:52:26

    In fact, starting from the principle, you will easily understand that what you want to bind is the control in the include, not the include, so it is natural to define the identification ID for the control, otherwise the object to be bound cannot be identified. And the essence of ButterKnife is to use findViewById. If you manually use the findViewById method, you will first get the include object, and then find the control to be bound by ViewById.

    reply
    0
  • Cancelreply