DialogFragment
设置 DialogFragment 的背景颜色透明
1.在DialogFragment的onCreateView里面设置,可以将对话框内部的背景设为透明
getDialog().getWindow().setBackgroundDrawable(newColorDrawable(Color.TRANSPARENT));
2.在DialogFragment的onstart里面设置,可以将对话框外部的背景设为透明
@Override
public void onStart() {
// TODO Auto-generated method stub
super.onStart();
Window window = getDialog().getWindow();
WindowManager.LayoutParams windowParams = window.getAttributes();
windowParams.dimAmount = 0.0f;
window.setAttributes(windowParams);
}