我记得之前看到过这样的代码,它采用方形图像(链接 iPhone 图标)并将角变圆,并添加像苹果在 iTunes 中那样的效果。基本上,我从 iTunes 获取图标图像,并希望使其看起来像商店中的一样。
谁能给我指明方向吗?
最佳答案
您需要导入QuartzCore
框架来实现以下功能:
下面的iconView
,(在本例中)应该是UIImageView
:
[iconView.layer setMasksToBounds:YES];
[iconView.layer setCornerRadius:5.0];
/* setting the border is not necessary, but is an option for you. */
[iconView.layer setBorderWidth:0.0f];
关于iphone - 图像的圆角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8570732/