-1

I have an application , where I drag a circular UIImageView on top of another UIImageView , and since a circle could never be squared , the white borders of the image must show , so I wonder if there is a way to remove those borders or to hide them (not by making them have the same color ).

1
  • Are you basically asking if you can turn a UIImageView into a circle, because i can give you the code for that. I just don't quite understand the question. Aug 20, 2014 at 16:34

2 Answers 2

1

I am expecting that you are looking for image masking feature. Have a look at this tutorial and this one too. Both of them uses CoreGraphics frame functions and are really quicker in response.

Please note that it is not the Swift version but will give you atleast a starter.

1
  • Your answer did work for me , but i think it's kind of long to mask an image , actually I have found that corner radius have did the same thing but with less code, but nevertheless I have finally understood what masking means Aug 20, 2014 at 23:07
1

try to set the image.layer.borderWidth = 0

(this is the swift version)

3
  • I have tried your code , I think you forgot to put the layer property though , and the border width didn't help me Aug 20, 2014 at 23:04
  • Well that was actually no real code you should take, just a suggestion. But sorry that did not work Aug 20, 2014 at 23:18
  • Can you post a screenshot of your problem? Aug 20, 2014 at 23:19

Your Answer

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

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