Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Revision as of 05:58, 18 September 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Multiline CEikLabel

From Wiki
Jump to: navigation, search
Article Metadata
Article
Created: User:Kanu123 (27 Jun 2007)
Last edited: hamishwillee (18 Sep 2012)

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.

This page was last modified on 18 September 2012, at 05:58.
42 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×