Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 12-29-2008, 11:33 PM   #2 (permalink)
mnemonic_fx
Registered Member
 
mnemonic_fx's Avatar
 
Join Date: Jun 2008
Posts: 419
mnemonic_fx is an unknown quantity at this point
Default

Code:
NSString *string = ...;

CGSize stringSize = [string sizeWithFont:[UIFont boldSystemFontOfSize:kTextFieldFontSize] constrainedToSize:CGSizeMake(320, 9999) lineBreakMode:UILineBreakModeWordWrap];
Then you could use the stringSize however you want, the key is in 9999 as a height.
You would rarely find any text view rect with more than 9999 as a height. Unless if it's an article or something.

Currently, I can not find any way to calculate it without constraint.

Last edited by mnemonic_fx; 12-29-2008 at 11:37 PM.
mnemonic_fx is offline   Reply With Quote
 

» Advertisements
» Online Users: 413
15 members and 398 guests
Alexanskoo, AragornSG, aziz, diane21, EvilElf, hrushikeshaddon, juanramoney, nicsmotherman, pipposanta, PixelEnvision, QuantumDoja, roelien, smashing, subhan1, tymex
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,609
Threads: 94,084
Posts: 402,783
Top Poster: BrianSlick (7,990)
Welcome to our newest member, diane21
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:44 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.