0

I have a the corner points of a rectangle on the screen and want to fit an UIImageView in this rectangle.

I want it like in this picture:

enter image description here

What's the best way to achieve this?

2
  • please do not only post the image but your current code as well as the exact input and desired output.
    – luk2302
    Nov 7, 2015 at 12:25
  • Pick a point i.e. top left or right or bottom , it will point1 . Now change the anchor point of view and set at any corner (according to picked point's corner). Get the angle between point2 (any of the points you have) from the corner point1. Set imageview's center at point1 and rotate it by angle. Hope This will help you. Nov 7, 2015 at 12:28

1 Answer 1

0

I think black box is UIImageView and you're trying it to place in screen as in the picture.

You can put the imageview in storyboard, in xib or in code to right side of screen. Then rotate it. For example below code rotates the imageview 20 degress.

float degrees = 20; //the value in degrees
imageView.transform = CGAffineTransformMakeRotation(degrees * M_PI/180); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.