我希望做一个自定义的BUTTON,首先在attrs.xml中定义了
<declare-styleable name="MyButton">
<attr name="who" format="string" />
</declare-styleable>多加了一个who属性然后在main.xml中,
加命名空间了xmlns:t=" http://schemas.android.com/apk/res/com.limaoyuan.button"然后在定义Button的地方
<com.limaoyuan.button.MyButton
t:who="aaad"/>
报No resource identifier found for attribute 'who' in package 'com.limaoyuan.button'
这是什么原因?在线等待
<declare-styleable name="MyButton">
<attr name="who" format="string" />
</declare-styleable>多加了一个who属性然后在main.xml中,
加命名空间了xmlns:t=" http://schemas.android.com/apk/res/com.limaoyuan.button"然后在定义Button的地方
<com.limaoyuan.button.MyButton
t:who="aaad"/>
报No resource identifier found for attribute 'who' in package 'com.limaoyuan.button'
这是什么原因?在线等待
解决方案 »
- android传字符串给PHP,可是PHP为什么解析出来是乱码
- VirtualBox + android-x86 问题解决
- 基于百度接口做的自动定位、但每次都要点击好几次才可以
- 如何使用Windowsmanager直接在屏幕上花slidingdrawer?
- android源码编译通过后编译单个模块时输出很多.ogg ignored.是怎么回事?
- 求帮忙解决一个技术问题,在线等
- 【代码】Android百度地图点击弹出信息框
- 建的sqlite数据库 导出不了
- 求YUV420P的格式转换为RGB565的demo
- 关于android:ellipzise
- sharepreferce里面可以放重复的嘛?
- 哪位大虾帮我该下代码
当初我也遇到过这个问题,最后放弃用自定义了!
R.styleable.xxx);
原因2:包名写错,多写或漏写
解决方式:
xmlns:ptr="http://schemas.android.com/apk/res/com.ycii.ljapp.ui",
com.ycii.ljapp.ui为AndroidManifest.xml 中定义的 package,即: <manifestxmlns:android="http://schemas.android.com/apk/res/android" package="com.ycii.ljapp.ui"
android:versionCode="1"
android:versionName="1.0" >