1. 添加外款的方法 是 画一个 sharp 然后设置成背景
sharp.xml 文件 内容如下
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#404040" />
<stroke android:width="1dp" android:color="#BBBBBB" />
<corners android:radius="6dp" />
<padding android:left="5dp" android:top="5dp" android:right="5dp" android:bottom="5dp" />
</shape>
2. sharp.xml 和 popupwindow 关联
View dialogView;
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
dialogView = inflater.inflate(R.layout.statusbox, null, false);
dialogView.setBackgroundResource(R.layout.statusbox_shape); //关联 popupwindow 和 sharp.xml
popupWindow = new PopupWindow(dialogView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true);//创建PopupWindow实例