错误:ERROR解析XML:第2行中的未绑定前缀

时间:2011-07-31 22:18:15

标签: android xml android-ui

这是我的代码......一切都应该是正确的,但是

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

1 个答案:

答案 0 :(得分:1)

在此代码中没有错误

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  />

但您必须设置任何容器视图的宽度和高度。 所以这可以像这样

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent">
</LinearLayout>