android popupwindow弹出菜单,Android popupwindow实现弹出菜单效果.pdf

这篇博客介绍了如何在Android中使用PopupWindow来创建一个弹出菜单,菜单包含确定和取消按钮。主要涉及的布局包括主Activity布局和PopupWindow布局,通过设置相应的属性实现了底部弹出并居中对齐的效果。
摘要由CSDN通过智能技术生成

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"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值