PersonalPopupWindow.java 文件源码

java
阅读 38 收藏 0 点赞 0 评论 0

项目:YiZhi 作者:
public PersonalPopupWindow(Context context) {
    super(null, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, true);
    mContext = context;
    //设置点击空白处消失
    setTouchable(true);
    setOutsideTouchable(true);
    setClippingEnabled(false);

    WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
    int w = wm.getDefaultDisplay().getWidth();
    int h = wm.getDefaultDisplay().getHeight();
    Bitmap bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
    bitmap.eraseColor(Color.parseColor("#88000000"));//填充颜色
    setBackgroundDrawable(new BitmapDrawable(context.getResources(), bitmap));

    initView();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号