在进行android学习的时候,第一个例子就碰到了问题,想想还没完全明白XML,得先从XML开始学习吧。具体代码如下。
这是main.xml的代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
androdi:id="@+id/txtView" <!--报错在这里。。。根据提示重写代码,又可以使用了 -->
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
不知道是哪里错了,Eclipse里报错:Error parsing XML: unbound prefix
最后重写了一下哪一行代码,结果又可以了。。。
是不是有点杯具呀。。。
经过一个修改,最终效果如下;
博客不知道怎么上图了。。。