DialogFragment背景顏色的設(shè)置兩個問題
1.解決布局默認(rèn)的白色邊框
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); //去除默認(rèn)白色邊框
View view = inflater.inflate(R.layout.lib_base_popup_screen_shot,container,false);
.....
return view;
}
2.設(shè)置對話框外部遮蓋層的透明度
@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);