报错信息如下:counter_fragment_with_tab.xml:12: AAPT: error: '#ff._aapt: error: ">
当前位置:   article > 正文

TabLayout 定制颜色导致编译失败_aapt: error: 'fill parent' is incompatible with at

aapt: error: 'fill parent' is incompatible with attribute layout_height (att
  1. <android.support.design.widget.TabLayout
  2. android:id="@+id/tabs"
  3. android:layout_width="match_parent"
  4. android:layout_height="wrap_content"
  5. app:tabBackground="#ff0000"
  6. />

报错信息如下:

Android  resource linking failed

counter_fragment_with_tab.xml:12: AAPT: error: '#ff0000' is incompatible with attribute tabBackground (attr) reference [weak].
    
改在color.xml中定义颜色后,问题解决:

  1. <android.support.design.widget.TabLayout
  2. android:id="@+id/tabs"
  3. android:layout_width="match_parent"
  4. android:layout_height="wrap_content"
  5. app:tabBackground="@color/colorPrimary"
  6. />
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <resources>
  3. <
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/511258
推荐阅读
相关标签
  

闽ICP备14008679号