ios - UIImageView subclass needs to handle resize -
i creating uiimageview subclass display audio waveform. approach load file, math, save png file , self.image = thepng
. nice part on resize or repaint uiimageview stretch png , stretch quickly.
now if image expanded need recalculate waveform avoid visible pixelation. since know uiimageview not call drawrect
, there method called during resize can decide if redrawing necessary?
p.s. when recalculating fading in new image after calculated. seamless user google earth.
here's solution:
- (void)layoutsubviews { [super layoutsubviews]; nslog(@"%@", nsstringfromcgrect(self.frame)); }
the trade off is not called each frame of animation, pointed out david jeske in is there uiview resize event?
other ideas didn't work:
override
setframe:(cgrect)frame
discussed @ is there uiview resize event?listen key-value observation, discussed @ https://groups.google.com/forum/#!topic/ococoa/uojau8rclwo
Comments
Post a Comment