android-layout - Android v7 网格布局

标签 android-layout android-widget

当我将 v7 GridLayout 放入线性布局时,我不断收到此错误:

标签 android.support.v7.widget.GridLayout 发现意外的命名空间前缀“xmlns”

如果我在线性或相对布局中没有 GridLayout,那么它会正常工作,但我必须在某种布局中使用 GridLayout,这样滚动才能工作,但我不断收到上面的错误?

有人知道如何防止布局中发生这种情况吗?

感谢您的帮助。

最佳答案

我认为这是 Lint 的一个已知问题:http://code.google.com/p/android/issues/detail?id=52831 .

只需将 tools:ignore="MissingPrefix"添加到 Gridlayout 项即可:

<android.support.v7.widget.GridLayout
...
tools:ignore="MissingPrefix">

为了能够使用此命名空间,请确保将其包含在根标记中:

xmlns:tools="http://schemas.android.com/tools"

关于android-layout - Android v7 网格布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15377503/

相关文章:

android - 我们能否将 Android 作为操作系统缩小到仅使用 70-80% 的实际屏幕?

android - Android上ListView的限制高度

android - 如何使用 Xamarin/Monodroid 设置自定义标题

Android EditText inputType ="none"不起作用,变为 "textMultiLine"

android - 如何手动触发广播事件

Android 应用程序在单击按钮后失败并停止

android - 如何以编程方式设置gridview的高度android

java - 修改进度条资源图片

android - 布置画面。需要工具栏留在底部

android-widget - 应用程序显示在应用程序列表中,但小部件未出现在小部件列表中(在 Android 2.2 手机上)