Android Library Project自定义控件属性无法找到说明

	在使用Android Library Project的时候,使用了自定义控件,命名空间我们通常会使用包名作为后缀
http://schemas.android.com/apk/com.custom.pkg, 然而子工程引用的时候却一直报错无法找到某某控件属性,查阅资料后发现,如果在Library Project里使用自定义控件的话,必须使用如下的命名空间 xmlns:custom="
http://schemas.android.com/apk/res-auto ",custom名字可以任取。以下是来自Google group上的讨论,在SDK release not应该也能看到。
 
It was closed because it was actually solved. Take a look into "what's new in sdk r17": 

Added support for custom views with custom attributes in libraries. Layouts using custom attributes must use the namespace URI http://schemas.android.com/apk/res-auto instead of the URI that includes the app package name. This URI is replaced with the app specific one at build time.
 
这里也做了说明,为什必须要用res-auto,原因是build的时候会将它体会为包名http://stackoverflow.com/questions/4461407/help-with-a-custom-view-attributes-inside-a-android-library-project/10217752#10217752
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值