TableViewCell Alignment Issue
I want to Align the tableviewcell content like the below screenshot
but my alignment is like below only.. 开发者_如何学Go
please any one help me to do..
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
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
精彩评论