//IOS7.0 in Use-(CGRect) Boundingrectwithsize: (cgsize) Size options: (nsstringdrawingoptions) Options attributes: ( Nsdictionary *) Attributes Context: (Nsstringdrawingcontext *) The context method can get the size of the label, from the adaptive height, replacing the previous-(cgsize) Sizewithfont: (Uifont *) font constrainedtosize: (cgsize) size Linebreakmode: (Nslinebreakmode) Linebreakmode method from Adaptive height //IOS7 method, label adaptive height according to content//set Max Size,width to 200 height max to 999Cgsize maxlabelsize = Cgsizemake ( $,999); Nsstringdrawingoptions options; Options= Nsstringdrawingtruncateslastvisibleline |Nsstringdrawinguseslinefragmentorigin; //to set the size of a font in a labelNsdictionary *attr = @{nsfontattributename: [Uifont systemfontofsize: -]}; //nodestring is to show the content, in fact, is to measure the size of nodestring on the label aboveCgsize labelsize =[nodestring boundingrectwithsize:maxlabelsize options:options Attributes:attr context:nil].size; NSLog (@"%s%d labelsize = (%f,%f)", __function__, __line__, Labelsize.width, labelsize.height);