Categories: UI | Symbian C++ | How To | Code Examples
This page was last modified 10:47, 9 April 2008.
Clipping longText to Fit Screen
From Forum Nokia Wiki
Sometimes display text will be so long that it goes out of screen,in such case we can use ClipToFit() method to show ".." of the text.
Here, is the code to do so,
const CFont* myFont = iEikonEnv->DenseFont(); TBuf<100> buffer; TInt aMaxWidthInPixels; //depending on your screen dimensions use this, for 176x208 //I use 100. buffer.Copy(_L("BackStreet Boys Music tracks")); AknTextUtils::ClipToFit(buffer,*myFont, aMaxWidthInPixels, AknTextUtils::EClipFromEnd, KDefaultClipWidth,_L("..."));
Now use this "buffer" in your Drawtext() method.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 关于模拟器和真机时钟精度,以及最高fps的问题,请大家一起讨论! | cach2008 | Symbian | 7 | 2006-02-16 03:10 |
| two text fields in a single row | hnipak | Mobile Java General | 11 | 2006-09-22 16:02 |
| Incorrect rgb values for jpg images on S40 3rd ed | bjudfar | Mobile Java Media (Graphics & Sounds) | 8 | 2007-05-29 16:34 |
| Need to redraw my whole screen | lazmous | Symbian Media (Graphics & Sounds) | 2 | 2006-02-11 11:08 |
| javax.microedition.m2g package | IvP | Mobile Java General | 3 | 2008-06-29 13:50 |
