2013-11-21 8 views
0

uitableview에서 진행률 표시 줄을 업데이트하는 방법을 처음 접했습니다. 내가 특정 셀에 단추를 클릭 할 때 일반적으로 나는, 나는 단지 사전에 저와 감사 도와주세요 해당 셀에서 진행 표시 줄을 표시하려면 버튼을 필요가있다 나는이보기를 희망uitableview의 진행률 표시 줄

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *simpleTableIdentifier = @"Categorycell"; 

    Categorycell *cell = (Categorycell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; 
    if (cell == nil) 
    { 
     NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"Categorycell" owner:self options:nil]; 
     cell = [nib objectAtIndex:0]; 
    } 
    [tableView setSeparatorColor:[UIColor clearColor]];- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *simpleTableIdentifier = @"Categorycell"; 

    Categorycell *cell = (Categorycell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; 
    if (cell == nil) 
    { 
     NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"Categorycell" owner:self options:nil]; 
     cell = [nib objectAtIndex:0]; 
    } 
    [tableView setSeparatorColor:[UIColor clearColor]]; 
    cell.selectionStyle=UITableViewCellSelectionStyleNone; 

    NSLog(@"Index : %d",indexPath.row); 
    NSString *str_filepath=[thumbnails objectAtIndex:indexPath.row]; 
    cell.cell_img.image=[[UIImage alloc]initWithContentsOfFile:str_filepath]; 

    cell.title.text=[arr_book objectAtIndex:indexPath.row]; 
    cell.sub_title.text=[arr_gen objectAtIndex:indexPath.row]; 
    NSString *str_rating=[arr_rating objectAtIndex:indexPath.row]; 
    int val_rating=[str_rating integerValue]; 

    // cell.cell_btn.hidden=YES; 

    cell.cell_btn.tag  = indexPath.row*10+1; 

    [cell.cell_btn addTarget:self action:@selector(btnDown:) forControlEvents:UIControlEventTouchUpInside]; 

    cell.cell_ReadBtn.tag  =indexPath.row*10+1; 
    [cell.cell_ReadBtn addTarget:self action:@selector(btnRead:) forControlEvents:UIControlEventTouchUpInside]; 

    cell.cell_Progress.tag= indexPath.row*10+1; 

    if(!bIspress) 
    { 
    cell.cell_Progress.hidden=YES; 
    } 
    NSString *comicbook_id = [arr_comic_id objectAtIndex:indexPath.row]; 
    NSString *filePath = [NSString stringWithFormat:@"book_%@.pdf",comicbook_id]; 
    NSLog(@"Book Name : %@",filePath); 
    if(![appDelegate check_Book_available:filePath]) 
    { 
     NSLog(@"Book Name Not : %@",filePath); 
    cell.cell_ReadBtn.hidden=YES; 
     cell.cell_btn.hidden= NO; 
    } 
    else 
    { 
     cell.cell_btn.hidden=YES; 
     cell.cell_ReadBtn.hidden=NO; 

    } 
    cell.tag=indexPath.row*10+1; 
    return cell; 
} 
+0

을 당신이 달성하기를 원하는 것을 설명하십시오. 나는 진보가 어떻게 셀 클릭에서 일어나는가를 의미합니다. – Retro

+0

나는 tablecell에서 버튼을 클릭 할 때 보여 주기만하면됩니다. 그 cell.i의 progreess 막대를 표시해야합니다 사실은 내가 버튼을 클릭 한 후 진행률 표시 줄을 숨길 뜻 progressbar를 보여 주 필요가 그게 나를 도와주세요 제발 – rakesh

+0

그래서 당신이 그것을 숨길 수 있지만 일부 스크린 샷을 추가 할 수 없습니다 뜻 – Retro

답변

1
-(void) btnDown:(id)sender { 
    UIButton* cellButton = (UIButton*)sender; 
    NSIndexPath* selectedIndexPath = [NSIndexPath indexPathForRow:cellButton.tag inSection:0]; 
    UITableViewCell* cell = [self.tableView cellForRowAtIndexPath:selectedIndexPath]; 

    for (id subView in cell.containView) { 
     if([subView isKindOfClass:[UIProgressView class]) { 
     UIProgressView * cellProgressView = (UIProgressView*)subView; 
     cellProgressView.frame = CGRectMake(10,10, 50,50); setYourFrame; 
     [cellProgressView setHidden:NO]; 
     } 
    } 
}