feizhanye 2015-05-12 22:42 采纳率: 0%
浏览 2073

在layout建立一个attrs.xml文件,在布局testinfo.xml 会报错

error: Error: No resource found that matches the given name (at 'background' with value '@drawable/ok'). [2015-05-13 06:41:13 - example] [2015-05-13 06:41:13 - example] : error: Error: No resource found that matches the given name (at 'background' with value '@drawable/cancle').
attrs.xml

<!--
     Declare custom theme attributes that allow changing which styles are
     used for button bars depending on the API level.
     ?android:attr/buttonBarStyle is new as of API 11 so this is
     necessary to support previous API levels.
-->
<declare-styleable name="ButtonBarContainerTheme">
    <attr name="buttonBarStyle" format="reference" />
    <attr name="buttonBarButtonStyle" format="reference" />
</declare-styleable>


testinfo.xml
<?xml version="1.0" encoding="utf-8"?>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
android:id="@+id/testlist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="4"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/bg" >

    <LinearLayout
        android:id="@+id/testlinear"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="25dp"
        android:layout_marginRight="25dp"
        android:layout_marginTop="5dp"
        android:background="@drawable/bg"
        android:orientation="vertical" 
        android:gravity="bottom">
    </LinearLayout>
</ScrollView>


android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:layout_weight="1"
android:orientation="horizontal"
android:background="@drawable/share_bg_tab_normal"
>
android:id="@+id/ok"
android:layout_marginLeft="15dp"
android:layout_marginRight="30dp"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="5dp"
android:paddingBottom="6dp"
android:layout_weight="1"
android:paddingTop="6dp"
android:background="@drawable/ok"
/>
android:layout_marginLeft="30dp"
android:layout_marginRight="15dp"
android:id="@+id/cancle"
android:paddingLeft="5dp"
android:paddingRight="10dp"
android:paddingBottom="6dp"
android:paddingTop="6dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="@drawable/cancle"
/>

  • 写回答

2条回答 默认 最新

  • danielinbiti 2015-05-13 01:21
    关注
     @drawable/ok
     @drawable/cancle
     检查一下这两个资源文件在对应的drawable目录下有没有
    
    评论

报告相同问题?

悬赏问题

  • ¥15 Matlab怎么求解含参的二重积分?
  • ¥15 苹果手机突然连不上wifi了?
  • ¥15 cgictest.cgi文件无法访问
  • ¥20 删除和修改功能无法调用
  • ¥15 kafka topic 所有分副本数修改
  • ¥15 小程序中fit格式等运动数据文件怎样实现可视化?(包含心率信息))
  • ¥15 如何利用mmdetection3d中的get_flops.py文件计算fcos3d方法的flops?
  • ¥40 串口调试助手打开串口后,keil5的代码就停止了
  • ¥15 电脑最近经常蓝屏,求大家看看哪的问题
  • ¥60 高价有偿求java辅导。工程量较大,价格你定,联系确定辅导后将采纳你的答案。希望能给出完整详细代码,并能解释回答我关于代码的疑问疑问,代码要求如下,联系我会发文档