Last active
August 29, 2015 14:17
-
-
Save edwardinubuntu/b52db21f922cda8f3160 to your computer and use it in GitHub Desktop.
Set image view height equals to width.
This file contains 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
final ImageView dreamImageView = (ImageView)rootView.findViewById(R.id.dream_image_view); | |
DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics(); | |
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams)dreamImageView.getLayoutParams(); | |
params.height = displayMetrics.widthPixels; | |
dreamImageView.setLayoutParams(params); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment