creating a scaled bitmap in onCreate() according to the Imageviews height and width

前提是你 提交于 2019-12-06 00:12:42

The height and width of the image view will only be calculated when a layout is requested for the parent view, which is after onCreate has finished. You should implement an OnGlobalLayoutListener and get the imageview's height and width from there. You shouldn't load your image in there, though, use an AsyncTask or some other approach to load it on the background.

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