leancloud / ChatKit-OC

此项目已经废弃,以后不再维护。我们推出了基于 Swift SDK 的 Chat Demo。
https://github.com/leancloud/swift-sdk-demo
MIT License
2.12k stars 461 forks source link

关于对话页面头像圆角问题的解决方案 #348

Open kuopenx opened 6 years ago

kuopenx commented 6 years ago

Base Info for this issue

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

1. How to repeat the problem.

1)已经设置了头像圆角的block方法,可是运行时发现在对话页面头像圆角并没有生效,但是经过再次刷新cell(拖到屏幕外再松手)圆角会生效,最近联系人页面的头像没有这个问题。

2)再就是chatkit内部设置的圆角方法回导致刷新页面时图片出现闪动(体验不是很好,但还可以接受),提一下

3)_avatarImageView.contentMode = UIViewContentModeScaleAspectFill;//防止特别长或者宽的图片显示不正常,防止图像太长会超出bounds,建议设置成此样式

2. Please help me in this way.

发现问题所在是头像设置圆角有个前提:frame不能是0,在设置了frame之后,圆角才能生效,亲测有效,可以在设置圆角代码前加上一句设置imageView.frame = CGRectMake(0, 0, 50, 50);

3. Here is a Demo.

ChenYilong commented 6 years ago

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