简体   繁体   English

如何使UIImage圆角,而不是圆角

[英]How to make UIImage rounded,Not rounded corner

Draw a circle,make a rounded UIImageView in it.How to get this, please guide me. 画一个圆,在其中制作一个圆形的UIImageView。如何获得这个,请指导我。 thx! 谢谢!

Let's put it this way, 这样说吧

  • First we create a UIImageView to the size of the circle you want.Let's say you want this image to be a circular image, 首先,我们创建一个UIImageView,使其大小达到您想要的圆形。假设您希望此图像为圆形图像,

http://united4iran.org/wp-content/uploads/2010/11/cell-phone-in-canada.jpg http://united4iran.org/wp-content/uploads/2010/11/cell-phone-in-canada.jpg

  • Then you create another UIImageView one top of the previous one to the size of 320x480 and set this image to it (Assume this image size is 320x480), 然后,创建另一个UIImageView,将它的上一个顶部设置为320x480,并将其设置为该图像(假设此图像的尺寸为320x480),

Note: also remember that inner area of the circle in above image is transparent. 注意:也请记住,上图中圆圈的内部区域是透明的。

  • Then you should get a image like this, 那你应该得到像这样的图像

http://img580.imageshack.us/img580/782/testjkn.png http://img580.imageshack.us/img580/782/testjkn.png

Hope this will help you. 希望这会帮助你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM