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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-20-2010, 10:15 AM   #1 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 3
ceperalta is on a distinguished road
Default How to know the displayed text in a UILabel

Dear dev.
I pass a long string to a UILabel; then the UILabel cut the text because the size. Now I want to know where in the original string the UILabel cut.

How to know the displayed text in a UILabel ?

This is for make custom layouts using columns ( like a newspaper, like de NYTimes iPad app)



Thank you in advance.
Charly
ceperalta is offline   Reply With Quote
Old 05-20-2010, 12:36 PM   #2 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 20
qahweh is on a distinguished road
Default

I don't know if there is a ready-made method for that. But if there's not, you could use a fixed-width font such as Terminal and then use higher-level division math to determine the amount of characters your UILabel fits.
qahweh is offline   Reply With Quote
Old 05-20-2010, 01:01 PM   #3 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 3
ceperalta is on a distinguished road
Default

Quote:
Originally Posted by qahweh View Post
I don't know if there is a ready-made method for that. But if there's not, you could use a fixed-width font such as Terminal and then use higher-level division math to determine the amount of characters your UILabel fits.
Thank you! Yes, I am trying to calculate this; but using Arial and is not exactly in any case. I will use fixed-width font like Terminal and I will tell you. Do you know about others fixed-width fonts?
ceperalta is offline   Reply With Quote
Old 05-20-2010, 01:09 PM   #4 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 20
qahweh is on a distinguished road
Default

Quote:
Originally Posted by ceperalta View Post
Do you know about others fixed-width fonts?
Samples of monospaced typefaces - Wikipedia, the free encyclopedia
qahweh is offline   Reply With Quote
Old 05-20-2010, 02:33 PM   #5 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 3
ceperalta is on a distinguished road
Default

Thank you again qahweh! Anyway, is not working in all the case.. I think there must be a way to know what is really displaying the UILabel... I will tell you if I know.
ceperalta is offline   Reply With Quote
Reply

Bookmarks

Tags
uilabel

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: 307
8 members and 299 guests
ajay123123, Fstuff, guusleijsten, HemiMG, newDev, pkIDSF, Sami Gh, Steven.C
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,648
Threads: 94,113
Posts: 402,877
Top Poster: BrianSlick (7,990)
Welcome to our newest member, brandon6031
Powered by vBadvanced CMPS v3.1.0

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