ChatKit-OC
ChatKit-OC copied to clipboard
avatar 圆角设置问题
Base Info for this issue
- ChatKit Version:1.0.0
- App-ID: XX
- Language:Objective-C
- iOS System Version:iOS10
- Prototype(是否是真机):YES
- Issue Type:Bug
1. How to repeat the problem.
代码设置了圆角
[[LCChatKit sharedInstance] setAvatarImageViewCornerRadiusBlock:^CGFloat(CGSize avatarImageViewSize) {
return (CGFloat)(avatarImageViewSize.width / 2);
}];
聊天页面的圆角设置有问题:
LCCKChatMessageCell.m文件修改源码,在设置圆角前设置frame
- (UIImageView *)avatarImageView { if (!_avatarImageView) { _avatarImageView = [[UIImageView alloc] init]; // _avatarImageView.contentMode = UIViewContentModeScaleAspectFit; _avatarImageView.contentMode = UIViewContentModeScaleAspectFill;//防止特别长或者宽的图片显示不正常 LCCKAvatarImageViewCornerRadiusBlock avatarImageViewCornerRadiusBlock = [LCChatKit sharedInstance].avatarImageViewCornerRadiusBlock; if (avatarImageViewCornerRadiusBlock) { CGSize avatarImageViewSize = CGSizeMake(kAvatarImageViewWidth, kAvatarImageViewHeight); CGFloat avatarImageViewCornerRadius = avatarImageViewCornerRadiusBlock(avatarImageViewSize); // self.avatarImageView.lcck_cornerRadius = avatarImageViewCornerRadius; _avatarImageView.frame = CGRectMake(0, 0, kAvatarImageViewWidth, kAvatarImageViewHeight);//此句代码是关键 _avatarImageView.lcck_cornerRadius = avatarImageViewCornerRadius; } [self bringSubviewToFront:_avatarImageView]; } return _avatarImageView;
@kuopenx 好的,谢谢。不过我通过pod安装的,改源码对团队开发有点麻烦。你对这段代码提了pull request 了吗?如果没有我可以把你这段代码提交pull request 吗?
@Guoxweii 没有呢,我只是还没确定还有没有其他影响,你觉得没什么问题就提交吧
@kuopenx 好的,那我暂时不提交吧,估计他们自己也发现这个问题了
fix in CYLChatKit https://github.com/ChenYilong/CYLChatKit/releases