Android 占屏幕所有宽度的DialogFragment
2018-07-25 本文已影响0人
hoffer_
@Override
public void onStart() {
super.onStart();
Window window = getDialog().getWindow();
window.setDimAmount(0);
window.setGravity(Gravity.BOTTOM);
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
window.requestFeature(Window.FEATURE_NO_TITLE);
window.setBackgroundDrawableResource(android.R.color.transparent);
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
View view = LayoutInflater.from(getActivity()).inflate(R.layout.layout_local_video_list,container,false);
return view;
}