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布局属性详解
- android 自定义Dialog背景透明及显示位置设置
- Android(安卓)Studio之Instant Run
- apk安装法之二----一段Android实现应用下载并自动安装apk包的代
- Android(安卓)px、dp、sp之间相互转换
- Android:启动页有短暂白屏的解决方法
- Android实现服务器登录
- android init 进程分析