parsing XML: unbound prefix
16lz
2021-12-04
在LinearLayout添加滚动效果的时,代码如下:
<?xml version="1.0" encoding="utf-8"?><ScrollViewandroid:layout_width="fill_parent"android:layout_height="fill_parent"android:scrollbars="vertical"android:fadingEdge="vertical"><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:scrollbarStyle="outsideInset" android:scrollbars="vertical">
结果保存的时候提示:acount_manage_activity.xml:2: error: Error parsing XML: unbound prefix
acount_manage_activity.xml:2就是代码的第二行
后发现
xmlns:android="http://schemas.android.com/apk/res/android"
必须作为第一个节点的属性,即将LinearLayout的xmlns:android属性去掉,ScrollView加上xmlns:android属性。
网上还有错误为
android:layout_width="fill_parent"
写成
Android:layout_width="fill_parent"
参考:
http://stackoverflow.com/questions/2221221/frequent-problem-in-android-view-error-parsing-xml-unbound-prefix
更多相关文章
- 让背景小图不是拉伸而是多个重复
- Android禁止锁屏,保持常亮方法
- Android(安卓)P Camera架构
- android 之 布局属性--RelativeLayout
- Android(安卓)Studio 快捷键
- Android(安卓)动态设置布局属性
- android动态给view设置可见、不可见属性
- 让背景小图不是拉伸而是多个重复
- windowSoftInputMode属性设置值