find the rect.size.height that contains nsstring given the rect.size.x

Member
Posts: 164
Joined: 2010.10
Post: #1
i'd like to make a popup that has dimension size.y variable and size.x fixed.
there is a method that find how much must be the y that contains all the text?
thanks
Quote this message in a reply
⌘-R in Chief
Posts: 1,260
Joined: 2002.05
Post: #2
I assume it's a custom popup…

At any rate, to find the height of a string, use NSAttributedString's boundingRectWithSize:options: method, with the option NSStringDrawingUsesLineFragmentOrigin, and size {fixedWidth, maxHeight}
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Malloc() Struct with NSString Inside? Graphic Ace 3 4,798 Jan 26, 2010 05:32 PM
Last Post: cmiller
  Finding the height of a point on a given list of vertexes? mikey 10 5,390 Jan 4, 2010 05:36 AM
Last Post: mikey
  Can't use NSString to put a number on screen? kensuguro 3 5,012 Nov 7, 2005 01:16 AM
Last Post: Jordan
  Getting Number From Character In NSString Nick 2 4,497 Oct 31, 2005 10:08 AM
Last Post: Nick
  Texturing height map problems nahid 6 4,287 Oct 14, 2005 10:24 PM
Last Post: hangt5