Created
December 5, 2018 05:57
-
-
Save hilfritz/f4650863968427e08df9c734e76892c7 to your computer and use it in GitHub Desktop.
android: changing dialogfragment width & height
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DialogFragmentClass{ | |
@Override | |
public void onStart() { | |
super.onStart(); | |
int width = (int)(getResources().getDisplayMetrics().widthPixels*0.95); | |
int height = (int)(getResources().getDisplayMetrics().heightPixels*0.30); | |
getDialog().getWindow().setLayout(width, ViewGroup.LayoutParams.WRAP_CONTENT); | |
//THIS WILL MAKE WIDTH 90% OF SCREEN | |
//HEIGHT WILL BE WRAP_CONTENT | |
//getDialog().getWindow().setLayout(width, height); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment