tableViewCell에 작성한 UILabel에 문제가 있습니다. 그래서 TextLabel, 세부 텍스트 및 cell에 세 번째로 생성 된 레이블이있는 tableView가 있습니다. 그래서 내가 JSON에서 정보를 얻을이 세 번째 레이블 그래서 그 결과를 붙여 넣습니다UILabel에 텍스트를 붙여 넣을 때 오류가 발생했습니다.
을하지만 난 내 테이블을 스크롤 할 때 나는 시간 텍스트 몇 가지 문제가 있습니다
을 그래서이 라벨에 배경색으로 UIColor 흰색을 추가했을 때 숫자 뒤에이 멍청이가 없습니다. 내가 뭘 잘못했는지 도와 줘?
가 나는 경우 조건의 경우 (셀 == 전무) 이외의 실수는 당신이 (다른 부분)에 라벨을 할당 한되어
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(! cell)
{
cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]autorelease];
cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]autorelease];
}
cell.textLabel.text = [[array objectAtIndex:indexPath.row]objectForKey:@"song"];
cell.detailTextLabel.text = [[array objectAtIndex:indexPath.row]objectForKey:@"artist"];
UILabel *mainLabel;
//frame=CGRectMake(Позиция по X, Позиция по Y, Размеры ширина, Раздел высота)
mainLabel = [[[UILabel alloc] initWithFrame:CGRectMake(70, 58, 220.0, 15.0)] autorelease];
mainLabel.font = [UIFont systemFontOfSize:14.0];
mainLabel.textColor = [UIColor blackColor];
[cell.contentView addSubview:mainLabel];
mainLabel.text = [[array objectAtIndex:indexPath.row]objectForKey:@"start"];
[cell.imageView setImageWithURL:[NSURL URLWithString:[[array objectAtIndex:indexPath.row] objectForKey:@"image"]] placeholderImage:[UIImage imageNamed:@"[email protected]"]];
cell.textLabel.textColor = [UIColor whiteColor];
cell.detailTextLabel.textColor = [UIColor whiteColor];
mainLabel.backgroundColor = [UIColor clearColor];
mainLabel.textColor = [UIColor whiteColor];
[tableTrack setBackgroundView:nil];
[TrackTableView setBackgroundView:nil];
tableTrack.backgroundColor = [UIColor clearColor];
TrackTableView.backgroundColor = [UIColor clearColor];
UIFont *f = [UIFont fontWithName:@"Helvetica 35 Thin" size:18.0f];
cell.textLabel.font = f;
UIFont *f2 = [UIFont fontWithName:@"Helvetica 35 Thin" size:14.0f];
cell.detailTextLabel.font = f2;
UIFont *f3 = [UIFont fontWithName:@"Helvetica 35 Thin" size:14.0f];
mainLabel.font = f3;
self.tableTrack.separatorStyle = UITableViewCellSeparatorStyleNone;
UIView *separatorView = [[UIView alloc] initWithFrame:CGRectMake(10, 74, 1024, 1)];
separatorView.layer.borderColor = [UIColor whiteColor].CGColor;
separatorView.layer.borderWidth = 0.5;
[cell.contentView addSubview:separatorView];
self.TrackTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
return cell;
}
데이터 소스 위임 방법을 제공하시기 바랍니다 ..이 코드를 시도! – Raon
내 코드 프로젝트를보고 싶습니까? – Genevios
아니요 cellForRowatIndexPath 대리자 메서드 만 – Raon