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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-22-2008, 07:30 AM   #1 (permalink)
I can't think without pen
 
Join Date: Jul 2008
Location: New York
Posts: 72
Default How can I display paragraph of text?

Hi everyone. I need to display bunch of text as paragraphs. I dont know the size of the text. I was thinking about the UILabel... how can i make UILabel to autoresize height to the content of the text? or is there other way to do it? thanks for your help.
aahmed753 is offline   Reply With Quote
Old 07-22-2008, 10:21 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2008
Posts: 189
Default

Try UITextView
Abel is offline   Reply With Quote
Old 07-22-2008, 11:00 AM   #3 (permalink)
I can't think without pen
 
Join Date: Jul 2008
Location: New York
Posts: 72
Default yes.

thanks, i realized it right after posting the thread. all i have to do is use UITextView and set it's editable property to NO.

However, i still have problem... the textview does not auto resize! I need it to resize to fit the content. thanks

thanks.

Last edited by aahmed753; 07-22-2008 at 11:08 AM.
aahmed753 is offline   Reply With Quote
Old 07-22-2008, 11:11 AM   #4 (permalink)
Registered Member
 
Join Date: Jul 2008
Posts: 189
Default

Only time I did that was in Java using font metrics and the text view's height and width properties.
Abel is offline   Reply With Quote
Old 07-22-2008, 05:02 PM   #5 (permalink)
New Member
 
Join Date: Apr 2008
Posts: 71
Default

Does [textView sizeToFit] not work?
halusha is offline   Reply With Quote
Old 07-22-2008, 07:46 PM   #6 (permalink)
New Member
 
Join Date: May 2008
Posts: 8
Default

Quote:
Originally Posted by aahmed753 View Post
Hi everyone. I need to display bunch of text as paragraphs. I dont know the size of the text. I was thinking about the UILabel... how can i make UILabel to autoresize height to the content of the text? or is there other way to do it? thanks for your help.
UILabel with line count of 0 and appropriate word wrapping would be another way. You just need to make sure the bounding box is large enough to hold the text you have.
kgelner is offline   Reply With Quote
Old 02-12-2009, 12:09 AM   #7 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: India
Posts: 239
Default Thank you sir

Quote:
Originally Posted by halusha View Post
Does [textView sizeToFit] not work?
Thank you very much...........

Your post helped me.
That was headache for me to autoresize the label at runtime as per the contents.

Once again thank you.
milanjansari is offline   Reply With Quote
Old 03-25-2009, 01:39 PM   #8 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 10
Default

Sorry, I am trying to show a paragraph (bunch of texts with new lines, bullet points, etc) with UITEXTVIEW... but i don't know how to...

Any ideas?
jin8k is offline   Reply With Quote
Old 05-01-2009, 08:22 AM   #9 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 98
Default

You can't do that with UITextView. You have to do those things with UIWebView.
XCHG is offline   Reply With Quote
Old 05-05-2009, 03:13 AM   #10 (permalink)
New Member
 
Join Date: Apr 2009
Posts: 8
Default

mark
aom7610 is offline   Reply With Quote
Old 11-18-2009, 02:52 PM   #11 (permalink)
Registered Member
 
Join Date: Aug 2009
Location: Mass
Posts: 14
Default can you save in uitextview

Quote:
Originally Posted by Abel View Post
Try UITextView
using textview but the items inside the text view is not being saved would like the text to remain after the user logs out the app meaning using the home button. how to do
iphonetony is offline   Reply With Quote
Old 11-18-2009, 03:56 PM   #12 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 98
Default

Quote:
Originally Posted by iphonetony View Post
using textview but the items inside the text view is not being saved would like the text to remain after the user logs out the app meaning using the home button. how to do
You have to save your value like this:

Code:
[[NSUserDefaults standardUserDefaults] setValue:@"VALUE" forKey:@"KEY"];
  [[NSUserDefaults standardUserDefaults] synchronize];
And retrieve it like this:

Code:
NSString *Value = (NSString*) [[NSUserDefaults standardUserDefaults] valueForKey:@"KEY"];
Change @"VALUE" to the text inside your UITextView.
__________________
UK Flights
Latest UK Flight information right in your iPhone/iPod Touch. All major UK Airports are available in this brilliant iPhone Application. Download from the iTunes Store.

GuitarMonster: Overdrive
A guitar plugged to an overdrive effect, right in your pocket. Download from the iTunes Store.
XCHG is offline   Reply With Quote
Old 10-14-2010, 04:13 AM   #13 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 14
Default

where would you place this code?
NichMadl is offline   Reply With Quote
Old 10-14-2010, 04:13 AM   #14 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 14
Default

Quote:
Originally Posted by milanjansari View Post
Thank you very much...........

Your post helped me.
That was headache for me to autoresize the label at runtime as per the contents.

Once again thank you.
where would you place this?
NichMadl is offline   Reply With Quote
Old 10-14-2010, 04:14 AM   #15 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 14
Default

where would you place this?
NichMadl is offline   Reply With Quote
Old 11-19-2010, 02:20 AM   #16 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 10
Default

Hi Nick, were you able to place the code properly ?
sebastien is offline   Reply With Quote
Reply

Bookmarks

Tags
label, paragraph, text, uilabel, uiview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 264
20 members and 244 guests
ADY, AragornSG, BrianSlick, Dani77, Dattee, dre, glenn_sayers, HDshot, HemiMG, JasonR, karlam963, nobre84, prchn4christ, Rudy, spiderguy84, themathminister, tomtom100, viniciusdamone, vogueestylee, vvenkatachallam
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,884
Threads: 89,229
Posts: 380,763
Top Poster: BrianSlick (7,129)
Welcome to our newest member, karlam963
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:19 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0