Когда нагрузка Дейты это показывает идеальный Ограничить-х и данные прекрасно показано с идеальным расстоянием ...Пользовательские ячейки изменения размера Выпуск
Пожалуйста, имеют вид к приспособлению, когда таблица полезной нагрузки:
Когда мы имеем меньше название, то это шоу расстояние:
Я загружая д ата из файлов:
код выглядит следующим образом-х:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
Customviewcell *cell=[tableView dequeueReusableCellWithIdentifier:@"cell"];
UIImage * image = [UIImage imageNamed:justThumbs[indexPath.row]];
cell.Customimage.image=image;
cell.CustomTitle.text=justTitles[indexPath.row];
[cell.CustomTitle sizeToFit];
NSString * htmlString =justDesc[indexPath.row];
NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
cell.CustomDes.attributedText=attrStr;
[cell.CustomDes sizeToFit];
[cell setNeedsDisplay];
[cell layoutIfNeeded];
return cell;
}
Загрузка данных из файла, как последующие годы:
-(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[tableviewcustom reloadData];
}
- (void)viewDidLoad {
[super viewDidLoad];
NSURL * url = [[NSBundle mainBundle]URLForResource:@"services" withExtension:@"plist"];
Servicestitle = [NSDictionary dictionaryWithContentsOfURL:url];
justTitles = [Servicestitle objectForKey:@"Title"];
justThumbs= [Servicestitle objectForKey:@"Thumbnail"];
justDesc=[Servicestitle objectForKey:@"Description"];
tableviewcustom.estimatedRowHeight = 150;
tableviewcustom.rowHeight = UITableViewAutomaticDimension;
[tableviewcustom reloadData];
// Do any additional setup after loading the view, typically from a nib.
}
Раскадровка как последуйте'S:
Добавление фона к названию и алфавиту:
первых 3 клетки:
после того, как первые три ячейки:
Спасибо за помощь.
Привет Talha Аслам ... На мой взгляд, Нужно ли отнести пользователя текст? –
Если вы не используете атрибутный текст, просто удалите следующую строку. ----- cell.CustomDes.attributedText = attrStr ----- и write ---- cell.CustomDes.text = attrStr. –
@JAGAT да, потому что это html и разбор html –