开发者

Contact image composition like Contacts app

I'm trying to replicate how the Contacts app shows user pictures in my own app, but am at a loss as to how they went abou开发者_如何学Ct it.

Here's how there's looks...

Contact image composition like Contacts app

...and (I assume) they are using a combination of these images (from the AddressBookUI framework) to accomplish it...

Contact image composition like Contacts app

Contact image composition like Contacts app

Contact image composition like Contacts app

...but I'm not sure how. Most methods I've tried require an image without an alpha channel, yet their image marked "mask" (middle one) has an alpha channel. I've also tried other masking methods that just mask out a color but that doesn't seem to be the route they take.

Any insight into this?


I don't think they are combining any images. They are probably doing something like this:

imageView.layer.cornerRadius = 5;
imageView.layer.borderColor = [UIColor lightGrayColor].CGColor;
imageView.layer.borderWidth = 3;
imageView.layer.masksToBounds = YES;

And then you can just set the the image of the imageView normally (imageView.image = [UIImage imageName:@"person.png"];)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜