Привет всем Я пользовательские элементы, в которых я имею UIImageView
и UILabel
я хочу назначить изображение для UIImageView
и текста в UILabel
, которые находятся в массиве, пожалуйста, может ли один помочь мне? ? спасибо заранееDispalying текст и этикетки в пользовательской ячейке UITableView
Я попытался ниже код
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text =[CurArray objectAtIndex:indexPath.row];
NSString *cellIcon = [[self IconArray] objectAtIndex:indexPath.row];
UIImage *cellIconimage = [UIImage imageNamed:cellIcon];
UIImageView *imageView = [[UIImageView alloc] initWithImage:cellIconimage];
[imageView setFrame:CGRectMake(100.0, 30.0, 30.0, 30.0)];
[imageView setContentMode:UIViewContentModeScaleAspectFill];
[cell addSubview:imageView];
return cell;
}
С помощью этого кода я могу назначить изображение для созданного ImageView Но я не в состоянии назначить текст для UILable
вставить код – Rajneesh071