【问题标题】:ToolBar Widget in Material DesignMaterial Design 中的 ToolBar 小部件
【发布时间】:2016-05-14 14:12:48
【问题描述】:

您好,我正在尝试学习 Material Design,但被工具栏代码卡住了。我对使用哪个库以及为什么显示此错误感到困惑

原因:android.view.InflateException: Binary XML file line #15: Error inflating class android.support.design.widget.Toolbar

为此,我正在使用支持库:

compile 'com.android.support:design:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'

如果你知道如何解决这个错误,请分享给我。在此先感谢

【问题讨论】:

  • 你是否导入了 appcompat 库?
  • 请向我们展示您设置的代码和您的styles.xml
  • 你需要compile 'com.android.support:appcompat-v7:23.1.1'

标签: android material-design android-toolbar


【解决方案1】:

你需要 appCompat 支持库

compile 'com.android.support:appcompat-v7-XXXX // XXXX is the version , choose latest.

如果您无法通过添加上述服务使其正常工作,请提供更多建议。

  • 添加相同版本的所有服务。
  • 清理项目。

更多建议在下面的链接中,这是类似的问题。

Reference

【讨论】:

    猜你喜欢
    • 2014-12-28
    • 1970-01-01
    • 2016-09-19
    • 1970-01-01
    • 2017-10-27
    • 1970-01-01
    • 2018-12-26
    • 1970-01-01
    • 2015-01-04
    相关资源
    最近更新 更多