how to get imageview to match parent dynamically code example Example: how to set imageview to fit the parent android:scaleType="centerCrop"