现在的位置: 首页 > 综合 > 正文

UICollectionView

2018年02月02日 ⁄ 综合 ⁄ 共 1370字 ⁄ 字号 评论关闭
UINib *cellNib = [UINib nibWithNibName:@"TujiCollCell" bundle:nil];
    [m_collectionView registerNib:cellNib forCellWithReuseIdentifier:@"TujiCollCell"];

//////////图集delegate

- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
    return 1;
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
   // NSMutableArray *sectionArray = [self.dataArray objectAtIndex:section];
    if(m_tujiList==nil)
        return 0;
    return [m_tujiList count];
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{

    
    static NSString *SimpleTableIdentifier=@"TujiCollCell";
	TujiCollCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:SimpleTableIdentifier forIndexPath:indexPath];

    struct XKHTujiNode node;
    [[m_tujiList objectAtIndex:indexPath.row]getValue:&node];
    
    cell.tujiLabel.text = node.title;

    EGOImageView * imageView= [zzJSON DownLoadImageForView:node.iconImg];
    imageView.frame = CGRectMake(5, 5, 120, 106);
    [cell addSubview:imageView];
    return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath
{
    if(indexPath.row == (m_tujiList.count-1))
    {
        m_listAddNum++;
        NSLog(@"%d",indexPath.row);
       
        NSThread *InitThread = [[NSThread alloc]initWithTarget:self selector:@selector(DownLoadTujiListFun:) object:self];
        [InitThread start];
        
        
        
    }
}

抱歉!评论已关闭.