感觉每次写的时候都会遇到R标红的情况,这次也是,但是解决了,记录一下。
后来看了一下我的Build,发现了错误,好像是我的xml文件出了问题。
crientation not found.于是就去看了我的xml文件。
<?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"
android:crientation="vertical" >//就是这里写错了!!!!
<Button
android:id="@+id/btnShow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Show Popup Menu"
android:layout_marginTop="200dp"
android:layout_marginLeft="100dp"/>
</LinearLayout>
我把crientation改成orientation之后就可以正常运行了。