当我调用uicollectionview 的reloadData方法时,界面没用刷新,cellForRowAtIndexPath方法也没调用
当我滚动界面的时候才代理调用cellForRowAtIndexPath方法
用[_collectionView reloadItemsAtIndexPaths:indexPath]也是和reloadData出现的情况一样
请哪位高手对collectionVIew比较熟悉的,帮帮忙...核心代码-(UICollectionViewCell*)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
PCWChatCollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:K_Chat_CollectionCell forIndexPath:indexPath];
cell.backgroundColor = [UIColor whiteColor];
cell.iconImageView.image = [UIImage imageNamed:@"icon_collectionviewcell_chat"];
cell.titleLable.text = @"二手车聊天室";
cell.detailLable.text = @"汇聚全国二手车商交流群";
cell.enterButton.tag = 1;
[cell setUnreadCount:[[RCIMClient sharedRCIMClient] getTotalUnreadCount]]
return cell;
}#pragma - 融云sdk接受消息回调
-(void)onReceived:(RCMessage *)message left:(int)nLeft object:(id)object
{
[_collectionView reloadData];
}
当我滚动界面的时候才代理调用cellForRowAtIndexPath方法
用[_collectionView reloadItemsAtIndexPaths:indexPath]也是和reloadData出现的情况一样
请哪位高手对collectionVIew比较熟悉的,帮帮忙...核心代码-(UICollectionViewCell*)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
PCWChatCollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:K_Chat_CollectionCell forIndexPath:indexPath];
cell.backgroundColor = [UIColor whiteColor];
cell.iconImageView.image = [UIImage imageNamed:@"icon_collectionviewcell_chat"];
cell.titleLable.text = @"二手车聊天室";
cell.detailLable.text = @"汇聚全国二手车商交流群";
cell.enterButton.tag = 1;
[cell setUnreadCount:[[RCIMClient sharedRCIMClient] getTotalUnreadCount]]
return cell;
}#pragma - 融云sdk接受消息回调
-(void)onReceived:(RCMessage *)message left:(int)nLeft object:(id)object
{
[_collectionView reloadData];
}
解决方案 »
- ASIHTTPRequest的问题
- 在将IPHONE中的文件输出到excel
- 问个通讯录的问题
- core text 在iPad中怎样设置位置
- ios平台,开发什么程序,会用到socket API ?
- @synthesize hello = _hello; 还不很理解。
- iOS 怎样获取Google calendar的内容
- 请教各位达人Mac上怎么调试iPod、iPhone的Safari上的网页
- 发布到Ipad上,线程报了个错:Tread 1:signal SIGABRT
- 请教下socket和http在客户端网络请求中的区别,请大神求教
- GLKView怎么不让controller自动调用DrawRect啊
- iOS中检测手机中是否装有某app
dispatch_async(dispatch_get_main_queue(), ^{
[ws appendAndDisplayMessage:message];
});