当前位置:   article > 正文

AndroidStudio之弹出窗实现(Popwindow)_android studio popwindow弹出页面

android studio popwindow弹出页面

先上效果图
在这里插入图片描述

基本使用方法

View view = getLayoutInflater().inflate(R.layout.activity_photo_preview, null);

 if (popupBigPhoto == null) {
            popupBigPhoto = new PopupWindow(view, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, true);
            popupBigPhoto.setOutsideTouchable(true);
            popupBigPhoto.setOnDismissListener(this);
        }
        if (popupBigPhoto.isShowing()) {
            popupBigPhoto.dismiss();
        } else {
            popupBigPhoto.showAtLocation(headview, Gravity.TOP, 0, 0);
        }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

基本属性方法

  • window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    设置PopupWindow的背景
  • window.setOutsideTouchable(true);
    设置PopupWindow是否能响应外部点击事件
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/267098?site
推荐阅读
相关标签
  

闽ICP备14008679号