我正在开发一个需要使GridLayout兼容的应用程序。因此,我遵循this链接中给出的步骤。我已经下载了zip文件夹,也做了库。在实现之前,一切都运行得很好。当我尝试按照给定链接中的描述更改main.xml时,我得到了。错误码如下。
<com.gridlayout.GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gridlayout="http://schemas.android.com/apk/res/com.CompatGrid.MakeCompatible"
android:layout_width="match_parent"
android:layout_height="match_parent"
gridlayout:alignmentMode="alignBounds"
gridlayout:columnCount="4"
gridlayout:columnOrderPreserved="false"
gridlayout:useDefaultMargins="true" >我的包名是"com.CompatGrid",我的Activity是"MakeCompatible".,错误在第3、4、5和6行。错误就是这样。
error:No resource identifier found for attribute 'alignmentMode' in package 'MakeCompatible'.
error:No resource identifier found for attribute 'columnCount' in package 'MakeCompatible'.
error:No resource identifier found for attribute 'columnOrderPreserved' in package 'MakeCompatible'.
error:No resource identifier found for attribute 'useDefaultMargins' in package 'MakeCompatible'.我已经按照指示去做了。
发布于 2012-07-31 20:36:52
经过一遍又一遍的阅读,我发现了我的错误。它在第二行。
xmlns:gridlayout="http://schemas.android.com/apk/res/com.CompatGrid.MakeCompatible"我将其编辑为
xmlns:gridlayout="http://schemas.android.com/apk/res/com.CompatGrid"我的错误是我必须在main.xml中使用包名,而不是主活动类名。
https://stackoverflow.com/questions/11722362
复制相似问题