Android popupwindow实现弹出菜单效果
上面图片中的确定按钮的效果。
也就是弹出菜单。
主activity布局
01. <?xml version="1.0" encoding="utf-8"?>
02.
03.
04.
05. android:id="@+id/com_example_menueffect_effect1_relativeLayout"
06. android:layout_height="match_parent"
07. android:layout_width="match_parent">
08.
09.
10.
android:id="@+id/com_example_menueffect_effect1_listView1"
11. android:layout_alignTop="@id/com_example_menueffect_effect1_relativeLayout"
12. android:layout_width="match_parent">
13.
14.
15. android:layout_width="wrap_content"
16. android:layout_height="wrap_content"
17. android:text="确定"
18.
19. android:layout_alignParentBottom="true"
20. android:layout_alignParentLeft="true">
21.
22.
23.
24. android:layout_width="wrap_content"
25. android:layout_height="wrap_content"
26. android:text="取消"
27.
28. android:layout_alignParentBottom="true"
29. android:layout_alignParentRight="true"
30. >
31.
31.
32.
33.
34.
复制代码
popupmenu布局
01. <?xml version="1.0" encoding="utf-8"?>
02.
03. xmlns:android="/apk/res/android"
04. android:orientation="vertical"
05. android:layout_width="wrap_content"
06. android:layout_height="wrap_content">
07.
08. android:id="@+id/com_example_menueffect_effect1_popupwindow_btnOpen"