Gradle工具会自动识别,所以不用指定包名
把
xmlns:xx="http://schemas.android.com/apk/res/com.xxx"
xmlns:xx="http://schemas.android.com/apk/res-auto"
然后同步一下
Android 自定义控件在Android Studio中xmlns不识别
原文:http://my.oschina.net/yaly/blog/467341