Using tableView estimatedHeightForRowAtIndexPath make cell blinks . I use following code
-(CGFloat )tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return UITableViewAutomaticDimension;
}
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
return UITableViewAutomaticDimension;
}
Create UITableViewCell textLabel vertically align to be always at the top. I use following code but doesnt work.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier1 = @"Cell";
UITableViewCell *cell1 = [tableView dequeueReusableCellWithIdentifier:CellIdentifier1];
if (cell1 == nil) {
cell1 = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier1];
}
cell1.textLabel.text = [self.itemDict objectForKey:kDESCRIPTION];
cell1.textLabel.numberOfLines = 0;
cell1.textLabel.font = [UIFont fontWithName:@"Helvetica" size:15];
cell1.textLabel.textColor = TextColor;
[cell1.textLabel sizeToFit];
return cell1;
}
I have got as First Image but want Second Image
I checked the following link but doesnt work out
Vertically align text to top within a UILabel