How works android ImageView android:scaleType=“fitXY” property?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 02:29:54

问题


I need to know how he takes drawable object. I'm collecting some ImageView objects in array, they have background images that are rather big in resolution so they take lot of memory... I have read somewhere that it will automatically create image with resolution that my imageView have, so i think it will take less memory than first one... Please tell me, if i set scaleType property, will it scale that image? Will that help me to save memory?


回答1:


It won't save you any memory to set the scaleType of the ImageView because the original backing Bitmap will still remain, regardless of which scaling you choose. Since you can resize or change the scale type dynamically there's no optimization that the ImageView can make with regards to image size.



来源:https://stackoverflow.com/questions/3547084/how-works-android-imageview-androidscaletype-fitxy-property

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!