这是mo.xml中:
 
 <com.android.yang.pan
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:id="@+id/rightPan" android:layout_gravity="right"
            mo:position="right" mo:open="@drawable/h1"
            mo:close="@drawable/h2" >
           <Button android:id="@+id/pan" android:layout_width="40dip"
                    android:layout_height="65dip" />
           <LinearLayout android:id="@+id/panCo"
                android:orientation="vertical" android:layout_width="95dip"
                android:layout_height="150dip" android:background="@drawable/co1">
           </LinearLayout>
</com.android.yang.pan>
 复制代码在android1.6上没错,但在android2.2上,这部分报错:
mo:position="right"    mo:   open="@drawable/h1"
mo:close="@drawable/h2"
报错如下:
packages/ps/yang/res/layout/mo.xml:83: error: No resource identifier found for attribute 'position' in package 'com.android.yang'
packages/ps/yang/res/layout/mo.xml:83: error: No resource identifier found for attribute 'open' in package 'com.android.yang'
packages/ps/yang/res/layout/mo.xml:83: error: No resource identifier found for attribute 'close' in package 'com.android.yang'
这到底是怎么回事?高手解答提示!

解决方案 »

  1.   

    你需要添加两张图片h1.png, h2.png在res/drawable目录下
      

  2.   


    蹭分
    还是这个问题啊
    你看看这个,不可能有问题的啊....
    http://blog.csdn.net/Android_Tutor/archive/2010/04/20/5508615.aspx
      

  3.   

    mo:position
    这几个mo的xml属性是系统的么?没有在sdk中看到
      

  4.   

    这个有用,自定义属性没有这么用过,都是自己解析XML。LZ看看吧,肯定你是少了什么定义。
      

  5.   

    貌似是少了这句
    将我们自定义的MyView 加入布局main.xml 文件中,平且使用自定义属性,自定义属性必须加上:      xmlns:test ="http://schemas.android.com/apk/res/com.android.tutor "蓝色 是自定义属性的前缀,红色 是我们包名.
      

  6.   

    将我们自定义的MyView 加入布局main.xml 文件中,平且使用自定义属性,自定义属性必须加上:      xmlns:test ="http://schemas.android.com/apk/res/com.android.tutor "蓝色 是自定义属性的前缀,红色 是我们包名.
      

  7.   

    xmlns:mo="http://schemas.android.com/apk/res/com.android.yang"这个有加阿
      

  8.   

    我知道了!
     在res/values 文件下定义一个attrs.xml 文件.代码如下:view plaincopy to clipboardprint?   1. 一、在res/values文件下定义一个attrs.xml文件.代码如下:  
       2. <?xml version="1.0" encoding="utf-8"?>  
       3. <resources>  
       4.     <declare-styleable name="MyView">  
       5.         <attr name="textColor" format="color" />  
       6.         <attr name="textSize" format="dimension" />  
       7.     </declare-styleable>  
       8. </resources> 
    忘了把android1.6的移植到attrs.xml中了,忘加属性定义了!
      

  9.   

    是不是xmlns:mo="http://schemas.android.com/apk/res/com.android.yang"
    这个后面是用工程的包名。
      

  10.   

    Multiple annotations found at this line:
    - error: No resource identifier found for attribute 'CityName' in package 
     'com.terry.weather'
    - error: No resource identifier found for attribute 'AutoLoad' in package 
     'com.terry.weather'
    - error: No resource identifier found for attribute 'UpdateHour' in package 
     'com.terry.weather'这是我以前的代码   NND  弄了我3天  最后才知道 是工程报名错误!