Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we set fixed height for AlertDialog ! #72

Open
deshario opened this issue Jan 4, 2017 · 1 comment
Open

Can we set fixed height for AlertDialog ! #72

deshario opened this issue Jan 4, 2017 · 1 comment
Labels

Comments

@deshario
Copy link

deshario commented Jan 4, 2017

Can we set fixed height of alertdialog and inflate dialog_fragment.xml into it ...
I had setup listview in dialog_fragment.xml and i want to set fixed height for alertdialog ... Is it possible !
capture

@deshario deshario changed the title Can we fixed height of AlertDialog ! Can we set fixed height for AlertDialog ! Jan 5, 2017
@tbarthel-fr
Copy link
Member

Hi @deshario

Inside you the onStart of your DialogFragment you cant specify a fixed height in px using dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, height);.

You might want to use a resource with a height in dp and resources.getDimensionPixelSize(R.dimen.popup_height) to avoid hardcoded pixel size.

Happy coding and have a good day (=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants