开发者

TableViewCell Alignment Issue

I want to Align the tableviewcell content like the below screenshot

TableViewCell Alignment Issue

but my alignment is like below only.. 开发者_如何学Go

TableViewCell Alignment Issue

please any one help me to do..

TableViewCell Alignment Issue

TableViewCell Alignment Issue

TableViewCell Alignment Issue


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜