GridLayout 是在 Android API Level 14 加进来的

它可用来取代 TableLayout

也提供了自由度较大且实用的排版功能

为了兼容 4.0 以下的较低版本

Android 提供了 android.support.v7.widget.GridLayout 这个 libuary

当使用 xml 档做画面排版的时候

如果是使用 android.support.v7.widget.GridLayout

有一些属性需要使用 app 这个 name space

app:orientation
app:columnCount
app:rowCount
app:alignmentMode
app:useDefaultMargins
app:columnOrderPreserved
app:rowOrderPreserved

但是问题来了

即使加上 name space 宣告

xmlns:app="http://schemas.android.com/apk/res/专案package"

Lint 还是会报错

Unexpected namespace prefix "app" found for tag android.support.v7.widget.GridLayout

这该如何是好?

找了一下解决方法,最后发现只要告诉 Lint 忽略这个问题就好了

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

解决 android.support.v7.widget.GridLayout 使用 xmlns:app 出现 error 的问题的更多相关文章

  1. 配置android.support.v7.widget.Toolbar 搜索框样式

    AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xm ...

  2. 报错:Binary XML file line #7: Error inflating class android.support.v7.widget.RecyclerView

    近期学习RecyclerView,使用eclipse引用RecyclerView.编写完demo后编译没有问题,一执行就挂掉,错误例如以下: 07-22 23:05:34.553: D/Android ...

  3. int android.support.v7.widget.RecyclerView$ViewHolder.mItemViewType' on a null.....

    Android.support.v7.widget.RecyclerView$ViewHolder.mItemViewType' on a null..空指针问题,费劲心思才找到报空指针的原因: 代码 ...

  4. android.support.v7.widget.Toolbar 中menu图标不显示问题

    <?xml version="1.0" encoding="utf-8"?><menu xmlns:android="http:// ...

  5. Error inflating class android.support.v7.widget.Toolbar

    建立程序的时候出现的错误 style.xml中的 <!-- Base application theme. --> <style name="AppTheme" ...

  6. Cause for NullPointerException android.support.v7.widget.RecyclerView.onMeasure

    because you have not set LinearLayoutManager to RecyclerView. for example: mRecyclerView = (Recycler ...

  7. android.support.v7.app.AppCompatActivity不能使用的解决办法

    最近Android Studio 更新到4.0版本后,在构建项目时使用 android.support.v7.XX android.support.v4.XX 发现在xml文件中,原先我最常使用的Dr ...

  8. android.support.design.widget.AppBarLayout 在android5.0+底部显示空白条问题

    在最外层使用 RelativeLayout作为根节点,同时设置 android:fitsSystemWindows="true"问题解决. <?xml version=&qu ...

  9. 【转】Caused by: java.lang.NoClassDefFoundError: android.support.v7.gridlayout.R$dimen 异常解决方法

    在使用gridlayout中遇到 Caused by: java.lang.NoClassDefFoundError: android.support.v7.gridlayout.R$dimen 问题 ...

随机推荐

  1. angularJS中的MVC思想?

    mvc 思想: 将应用程序的组成,划分为三个部分:model , controller 和 view ; - 控制器的作用是用来初始化模型用的: - 模型就是用于存储数据的: - 视图是展示数据的: ...

  2. 增量式PID的matlab实现

    首先,增量式PID的实现公式: 式中 Δe(k)=e(k)-e(k-1) 进一步可以改写成 式中      . . 为了便于理解,也可写成: 式中e(k)为第k次采样时的设定值与实际值的差,e(k-1 ...

  3. request常用的方法

    request方法综合:-- 返回请求方式:-request.getMethod()-----GET返回URI中的资源名称(位于URL中端口后的资源路径):-request.getRequestURI ...

  4. Codeforces Round #438 by Sberbank and Barcelona Bootcamp (Div. 1 + Div. 2 combined)

    A. Bark to Unlock 题目链接:http://codeforces.com/contest/868/problem/A 题目意思:密码是两个字符组成的,现在你有n个由两个字符组成的字符串 ...

  5. ArrayList遍历的三种方式 array arrayList转换

    ArrayList遍历的三种方式 - 呵呵静 - 博客园 https://www.cnblogs.com/mjyung/p/6725182.html

  6. talib 中文文档(十):Price Transform Functions 价格指标

    Price Transform Functions AVGPRICE - Average Price 函数名:AVGPRICE 名称:平均价格函数 real = AVGPRICE(open, high ...

  7. python sort、sorted高级排序技巧(转)

    add by zhj: 没找到原文.可以按多个维度进行排序,而且可以指定他们的排序方向,如果维度都是数字,排序比较容易,用+/-号就可以 指定排序方向.否则,就调用多次sorted进行排序了,而且要按 ...

  8. HTML---初识HTML

    版权声明:本文为博主原创文章.不经博主同意注明链接就可以转载. https://blog.csdn.net/Senior_lee/article/details/33723573          H ...

  9. The adidas NMD Singapore is one of the brands top selling

    Like pointed out, we've two adidas NMD Singapore releases using the first arriving Blue and Black as ...

  10. Python笔记 #05# Package & pip3

    datacamp + 日常收集 How to install Package pip3 & What is difference between pip and pip3? Import  P ...