You Are Here:

Community: Wiki

This page was last modified on 3 June 2009, at 05:00.

Multiline CEikLabel

From Forum Nokia Wiki

A label control is displayed as a single line. So a long text will not be shown if it goes out of screen.

So to show a label which has a long text length, one should just provide the screenwidth or rect wherein the label is to be shown to the following function

Header files :

#include <eiklabel.h>
#include <AknUtils.h>

Link against:

LIBRARY avkon.lib eikcore.lib gdi.lib

Source:

AknTextUtils::WrapToArrayL(*iLabelText, iScreenWidth, *iFont, *iTextArray);

where iFont can be

iFont=CCoeEnv::Static()->NormalFont();

iTextArray is the array in which the long text will be split depending on the iScreenWidth.

Once this is done just add a "\n" to all the array elements and make a single text of all the elements.

Then

SetTextL(iWrappedText->Des());
SetExtent(iXY, (*this).MinimumSize());

Where iWrappedText is the HBufC in which the iTextArray elements are appended to make a single line of text with the "\n"'s .

Following the above steps gives a multiline custom CEikLabel.

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fTalkE3aE4cargeE5fscreenE5fsaverX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ