2012-07-30 221 views
0

我正在为我需要使GridLayout兼容的应用程序工作。所以我遵循this链接中给出的步骤。我已经下载了zip文件夹,并且已经制作了它的库。一切工作正常,直到实施。当我试图按照给定链接中所述更改main.xml时,我正在获取。错误代码如下。GridLayout兼容性

<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'. 

我按照指示完成了。

回答

1

一次又一次地阅读后,我发现我的错误。它在第二行。

xmlns:gridlayout="http://schemas.android.com/apk/res/com.CompatGrid.MakeCompatible" 

我把它编辑到

xmlns:gridlayout="http://schemas.android.com/apk/res/com.CompatGrid" 

我的错误是我原来用的是包名称,而不是在main.xml中的主要活动类的名字。