UILabel align to top
UILabel will always align to the middle of the size of the control. So if you want to align to the top of margin, you have to set the height of the control exact the same to the height that need to show the text:
UILabel *l2; // l2 is the label that we are working
// find the new height
CGRect l2Rect = [l2 textRectForBounds:l2.bounds limitedToNumberOfLines:999];
// reset the height
CGRect f = l2.frame;
f.size.height = l2Rect.size.height;
l2.frame = f;
Submitted by water on Thu, 2009-10-22 17:37

Recent comments
17 weeks 5 days ago
23 weeks 17 hours ago
26 weeks 3 days ago
27 weeks 3 days ago
36 weeks 1 day ago
36 weeks 1 day ago
36 weeks 2 days ago
36 weeks 4 days ago
38 weeks 2 days ago
38 weeks 3 days ago