ChatKit-OC icon indicating copy to clipboard operation
ChatKit-OC copied to clipboard

avatar 圆角设置问题

Open Guoxweii opened this issue 6 years ago • 5 comments

Base Info for this issue

  1. ChatKit Version:1.0.0
  2. App-ID: XX
  3. Language:Objective-C
  4. iOS System Version:iOS10
  5. Prototype(是否是真机):YES
  6. Issue Type:Bug

1. How to repeat the problem.

代码设置了圆角

   [[LCChatKit sharedInstance] setAvatarImageViewCornerRadiusBlock:^CGFloat(CGSize avatarImageViewSize) {
       return (CGFloat)(avatarImageViewSize.width / 2);
   }];

聊天页面的圆角设置有问题:

img_1928

Guoxweii avatar Sep 04 '17 13:09 Guoxweii

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 avatar Sep 09 '17 08:09 kuopenx

@kuopenx 好的,谢谢。不过我通过pod安装的,改源码对团队开发有点麻烦。你对这段代码提了pull request 了吗?如果没有我可以把你这段代码提交pull request 吗?

Guoxweii avatar Sep 09 '17 12:09 Guoxweii

@Guoxweii 没有呢,我只是还没确定还有没有其他影响,你觉得没什么问题就提交吧

kuopenx avatar Sep 09 '17 12:09 kuopenx

@kuopenx 好的,那我暂时不提交吧,估计他们自己也发现这个问题了

Guoxweii avatar Sep 09 '17 12:09 Guoxweii

fix in CYLChatKit https://github.com/ChenYilong/CYLChatKit/releases

ChenYilong avatar Jun 14 '18 17:06 ChenYilong