xmlns

xmlns是XML Namespaces的縮寫,中文名稱是XML命名空間。
使用的規則爲,首先定義命名空間xmlns:namespace-prefix="namespaceURI"。
Android中xml中的使用是:xmlns:前綴=http://schemas.android.com/apk/res/應用程序包路徑;
然後使用的時候按格式:namespace-prefix(前綴):屬性
如果使用xmlns,則xmlns的定義必須放在最外層開始的的標記中
當命名空間被定義之後,所有帶有相同前綴的子元素都會與同一個命名空間相關聯。避免XML解析器對xml解析時的發送名字衝突,這就是使用xmlns的必要性。當自定義的View有自己的屬性的時候,就用到xmlns來定義一個命名空間。

Unexpected namespace prefix “xmlns” found for XXXX

Solution:

Please try following:

1.Remove "?xml version="1.0" encoding="utf-8"?" line from the top.

2.Remove "xmlns:android="http://schemas.android.com/apk/res/android" from all the place excluding the ScrollView. I believe it is sufficient to inform it to the application once.

去掉 第二個"xmlns:android="http://schemas.android.com/apk/res/android" 

 來源:http://www.mythroad.net/2013/02/19/%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88unexpected-namespace-prefix-xmlns-found-for-tag-layout/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章