Strange UIImage problem

2019-09-17 05:09发布

问题:

My app takes an image from UIImagePicker and displays it but after scrolling through the images in a uiscrollview a few times, an image can mostly not be displayed, replaced with blank spots where it should be instead. After that various ui elements can disappear, for example other uiimages, and the time on the phone lock screen until the app's closed.

I'm unsure how to describe this to well, maybe it'll ring a bell with someone. It only happens when the uiimages are added to subview.

回答1:

I had the same problem and took me some times to figure it out. But the actual answer is pretty easy. Look at the "size inspector" and check "autoresizing" for your UIImageView. It changes the way your UIImageView is positioned and sized after you use a scroll.