Popwindow的頻率還是比較高的,爲了避免每次使用都單獨創建浪費時間,浪費精力所以封裝了一個通用的Popwindow 使用效果圖
使用方法:
CustomPopupWindow customPopupWindow = new CustomPopupWindow.Builder()
.with(MainActivity.this)
.setContentView(R.layout.pop_view)
.setwidth(100)
.setheight(100)
.setBackGroudAlpha(MainActivity.this, 0.7f)
.setAnimationStyle(CustomPopupWindow.Builder.STYLE2)
.setFouse(true)
.setOutSideCancel(true)
.builder().showAsLaction(view, Gravity.CENTER, 0, 0);