转载:https://blog.csdn.net/a15122282003/article/details/54314798
最近发现使用popwindow时有黑色边框
发现是由于继承父类PopWindow的原因,然后便使用了父类的一系列属性
public DevicePopWindow(Context context) {
super(context);//都是super惹的祸
View v = LayoutInflater.from(context).inflate(R.layout.left_menu, null);
RelativeLayout rl_colse = (RelativeLayout) v.findViewById(R.id.rl_colse);
rl_colse.setAlpha(1f);
recycler_left_menu = (RecyclerView) v.findViewById(R.id.recycler_left_menu);
deviceAdapter = new DeviceAdapter(context);
recycler_left_menu.setLayoutManager(new LinearLayoutManager(context));
recycler_left_menu.setAdapter(deviceAdapter);
recycler_left_menu.addItemDecoration(new DividerGridItemDecoration(context,0));
left_menu_close = (ImageView) v.findViewById(R.id.left_menu_close);
setListeners();
setWidth(Utils.dip2px(context, 260));
setHeight(ViewGroup.LayoutParams.MATCH_PARENT);
setContentView(v);
}
删掉 super(context)即可
亲测有效,以此记录!