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

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?
Quote this message in a reply
⌘-R in Chief
Posts: 1,277
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 6,912 Jan 26, 2010 05:32 PM
Last Post: mysteriouspants
  Finding the height of a point on a given list of vertexes? mikey 10 9,691 Jan 4, 2010 05:36 AM
Last Post: mikey
  Can't use NSString to put a number on screen? kensuguro 3 6,798 Nov 7, 2005 01:16 AM
Last Post: Jordan
  Getting Number From Character In NSString Nick 2 6,056 Oct 31, 2005 10:08 AM
Last Post: Nick
  Texturing height map problems nahid 6 6,368 Oct 14, 2005 10:24 PM
Last Post: hangt5