Organizational Research By

Surprising Reserch Topic

boundingrectwithsize for nsattributedstring returning wrong size


boundingrectwithsize for nsattributedstring returning wrong size  using -'iphone,ios,ipad'

I am trying to get the rect for an attributed string, but the boundingRectWithSize call is not respecting the size I pass in and is returning a rect with a single line height as opposed to a large height (it is a long string). I have experimented by passing in a very large value for the height and also 0 as in the code below, but the rect returned is always the same.

CGRect paragraphRect = [attributedText boundingRectWithSize:CGSizeMake(300,0.0)
  options:NSStringDrawingUsesDeviceMetrics
  context:nil];


Is this broken, or do I need to do something else to have it returned a rect for wrapped text?
    

asked Oct 6, 2015 by tushar2k6
0 votes
205 views



Related Hot Questions

15 Answers

0 votes
NULL
answered Oct 6, 2015 by santosh soni
0 votes
NULL
answered Oct 6, 2015 by r3tt
0 votes
NULL
answered Oct 6, 2015 by rajnipancholi
0 votes
NULL
answered Oct 6, 2015 by ashish singh
0 votes
NULL
answered Oct 6, 2015 by vickeykumar66
0 votes
NULL
answered Oct 6, 2015 by jekbishnoi
0 votes
NULL
answered Oct 6, 2015 by vibhorsingh
0 votes
NULL
answered Oct 6, 2015 by gauravsinghal83
0 votes
NULL
answered Oct 6, 2015 by rajeshujade
0 votes
NULL
answered Oct 6, 2015 by loknath.ganji
0 votes
NULL
answered Oct 6, 2015 by mca.agarwal
0 votes
NULL
answered Oct 6, 2015 by tejas lakhani
0 votes
NULL
answered Oct 6, 2015 by abhi
0 votes
NULL
answered Oct 6, 2015 by ankitarajoria4
0 votes
NULL
answered Oct 6, 2015 by mannar kande

...