我正在尝试使FBSDKProfilePictureView取整,但是我不能。

这是我所拥有的:

ViewController.h

@property (weak, nonatomic) IBOutlet FBSDKProfilePictureView *fbPhoto;


ViewDidLoad上的ViewController.m

self.fbPhoto.layer.cornerRadius = 30.0;
self.fbPhoto.layer.borderColor = [UIColor lightGrayColor].CGColor;
self.fbPhoto.layer.borderWidth = 1.0;


它在UIIMage前面制作了一个圆形圆圈,但没有“裁剪”图像。

我该怎么做

最佳答案

只需设置clipsToBounds

self.fbPhoto.layer.cornerRadius = 30.0;
self.fbPhoto.clipsToBounds=YES;
self.fbPhoto.layer.borderColor = [UIColor lightGrayColor].CGColor;
self.fbPhoto.layer.borderWidth = 1.0;

关于ios - 如何使iOS FBSDKProfilePictureView回合?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30137959/

10-09 04:15