Asked
Active
Viewed 65 times
0
-
Please crop extractly your image. – trungduc Oct 31 '17 at 06:44
-
I don't know what is problem here – trungduc Oct 31 '17 at 06:45
-
this is image with dynamic frame.here top-Right and bottom-Right of image have different x and y coordinates. – Nimit Oct 31 '17 at 06:45
-
there is nothing more complex . you don't need to give (width , height , OR aspect ratio) to ImageView . UIImageView will automatic take width/height based on image size. just give x and y for it. that's it. – Er.Gopal Vasani Oct 31 '17 at 06:45
-
do you mean the red area or all of image? – trungduc Oct 31 '17 at 06:45
-
@GOPALVASANI i don't think `UIImageView` will automatic take width/height based on image size ;) – trungduc Oct 31 '17 at 06:46
-
@Nimit , without trying how can u say that , just try it first. – Er.Gopal Vasani Oct 31 '17 at 06:47
-
@GOPALVASANI you are going to wrong way.i need to set different x and y position from top and bottom of imageview. it does't concert with image of autolayout – Nimit Oct 31 '17 at 06:49
-
@GOPALVASANI i tried like you said and image didn't appear ;) – trungduc Oct 31 '17 at 06:50
-
@Nimit i think the solution is you should create a new image with your image inside, you can put your image anywhere in your new image. After that set new image to UIImageView – trungduc Oct 31 '17 at 06:52
-
@trungduc , if you can't see Image rendering in Xib then , may be your imagesize is not proper OR also check its name. – Er.Gopal Vasani Oct 31 '17 at 06:55
-
@GOPALVASANI Thank for your very helpful advance ;). Can you give me a small project to explain what you said is right? – trungduc Oct 31 '17 at 07:00
-
@trungduc . here is the link : https://www.dropbox.com/s/th6awnvuj6u5sdu/ImageViewDemo.zip?dl=0 and you can see that , i have not gave any width/height constraint . – Er.Gopal Vasani Oct 31 '17 at 07:12
1 Answers
0
You will need to use UIBazierPath, on your image and set its frame, for that you will need to give it x and y values, so you should know the exact frame.
try this link: i want to crop image using any close path like UIBezierPath. it is possible in iPhone application?

Bhumit Muchhadia
- 128
- 9