ios - Clip to bounds of a different UIImageView -


i have 2 uiimageviews, imageview1 , imageview2. i've set

self.imageview1.clipstobounds = yes; 

but wondering if possible set imageview1 cliptobounds of imageview2?

not easily. "right" way use clipping path on imageview1's layer. however, can same effect more follows.

put imageview1 centered inside container uiview, , turn view's clipstobounds on. then:

  • if you're using auto layout, constrain container view's size equal size of imageview2.

  • if you're not using auto layout, set bounds of container view size of imageview2 whenever calculate layout.


Comments

Popular posts from this blog

angularjs - Showing an empty as first option in select tag -

qt - Change color of QGraphicsView rubber band -

c++ - Visible files in the "Projects" View of the Qt Creator IDE if using the CMake build system -