ios - How to find out when UILabel wordwraps -



ios - How to find out when UILabel wordwraps -

i have created couple of different uitableviewcells tableviewcontroller, because have different bits of info want display depending comes back. because of each uitableviewcell of different height.

this fine, 1 of uilabels has display big nsstring, big have had word wrap onto sec line, issue here messes uitableviewcell formatting.

my question is, possible flag or capture type of action when uilabel receiving nsstring has utilize wordrap because size of nsstring long?

or there way calculate physical length (not how many chars in string) of nsstring can decide hey need reformat uitableviewcell..

any help appreciated.

the usual way utilize sizewithfont:constrainedtosize:linebreakmode: size of string. utilize this:

cgsize stringsize = [thestring sizewithfont:[uifont fontwithname:@"helvetica neue" size:12] constrainedtosize:cgsizemake(320, 3000) linebreakmode:nslinebreakbywordwrapping ];

this set total width of table cell, want utilize width of label instead.

ios uitableview nsstring uilabel

Comments

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

How do you set up a perforce server to work over the internet? -

ios - Lagging ScrollView with UIWebview inside -