Reputation: 666
I want to Align the tableviewcell content like the below screenshot
but my alignment is like below only..
please any one help me to do..
Upvotes: 0
Views: 132
Reputation: 4301
In Interface Builder, edit Autosizing of the bottom right label so the text is pushed to the top. This is in the Size Inspector tab
Upvotes: 1
Reputation: 6465
Here is the code for top aligning of label text. Unfortunately there is no directly method for vertical alignment got UILabel.
//Code for top aligning text of UILabel
CGSize maximumSize = CGSizeMake(290, 35);
NSString *dateString =[[[reviewDic valueForKey:@"reviews"] objectAtIndex:[indexPath row]] objectForKey:@"summary"];
UIFont *dateFont = [UIFont fontWithName:@"Helvetica" size:14];
CGSize dateStringSize = [dateString sizeWithFont:dateFont constrainedToSize:maximumSize lineBreakMode:reviewLabel.lineBreakMode];
CGRect dateFrame = CGRectMake(5, 17, 290, dateStringSize.height);
reviewLabel.frame = dateFrame;
***reviewLabel will be repalced by your Label and you will have to make some adjustments according to your need. Hope this will help
Upvotes: 1