View popview = View.inflate(activity, R.layout.popwindow_layout, null);
int width = Dp2pxUtils.Dp2Px(context, 150f);
popupWindow = new PopupWindow(popview, width, LinearLayout.LayoutParams.WRAP_CONTENT);
AnimationUtils.showTitlePopWindowAnimation(popview);//给popwindow添加动画
initPopWindowListview(popview);
popupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
View parent = View.inflate(context, R.layout.activity_main_drawerlayout, null);
Rect frame = new Rect();
activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);
int x = Dp2pxUtils.Dp2Px(context, 20f);
int titleHeight = Dp2pxUtils.Dp2Px(context, 60f);
/**
* parent:弹窗放置的父布局
* Gravity.TOP + Gravity.RIGHT 该布局的右上角
* x 相对于右上角x方向偏移多少
* fram.top+titleHeight y方向上的偏移值。
*/
popupWindow.showAtLocation(parent, Gravity.TOP + Gravity.RIGHT, x, frame.top + titleHeight);
popupWindow.setOutsideTouchable(true);
popupWindow.setFocusable(true);
popupWindow.update();
popOutShadow(popupWindow);//使popwindow以外区域阴影显示

最新文章

  1. c++ 陷阱
  2. NOI 09:奇数求和
  3. 如果需要将UIView的4个角全部都为圆角,做法相当简单,只需设置其Layer的cornerRadius属性即可
  4. iOS 学习 - 13.微信分享链接、QQ 分享图片
  5. sublime exclude folder?
  6. postgresql pg_hba.conf
  7. deeplearning.ai 人工智能行业大师访谈 Andrej Karpathy 听课笔记
  8. 编译安装python3.6后pip3无法安装模块问题处理
  9. 各位情人节快乐, Python帮忙撒狗粮, 我连夜做了这个程序!
  10. c/c++ 多线程 层级锁
  11. ubuntu apt 安装 mpv
  12. Linux系统安装 OpenSSL两种方法
  13. Android 程序崩溃之后fragment出现画面重叠问题
  14. cf1088D Ehab and another another xor problem (构造)
  15. luogu1397 [NOI2013]矩阵游戏 (等比数列求和)
  16. UVA - 11732 "strcmp()" Anyone? (trie)
  17. STLINK V2安装使用详解
  18. Mui --- app与服务器之间的交互原理、mui ajax使用
  19. 解决使用Properties读取中文乱码问题
  20. 洛谷P1941 飞扬的小鸟 [noip2014] 背包

热门文章

  1. JSON Web Token
  2. Go 性能分析
  3. Postfix Completion 的使用
  4. iOS缓存使用的框架
  5. 免安装版的MySQL的安装与配置
  6. zjuoj The 12th Zhejiang Provincial Collegiate Programming Contest Ace of Aces
  7. jquery on 动态添加的元素,神奇的bug
  8. Linux 远程和本地的一些解决方案
  9. java数组转化成集合
  10. 手机端 zepto tap事件穿透