Search code examples
iosrotationscaleshadow

IOS - How to draw a border and a shadow that rotates with view but doesn't scale with it


I am developing an ios app. In my app I have got a view, the view is has got a border and a shadow. The view can be scaled and rotated. When a user scaled my view it causes my border and shadow to scale as well. I don't want my shadow or border to scale at all. On the other hand I do want my shadow and border to rotate when I rotate the view.

Is there any built in mechanism to prevent border \ shadow scale?

Thank you


Solution

  • As far as I know there isn't such a built in mechanism. The only way I see for you to solve your problem is to simply use two different views, with different management in case of rotation.

    Have one view as a sort of background and add your border and shadow to it, and then place the content on top of it (or in it, depends on your case).