WEB开发网
开发学院手机开发Symbian 开发 关于在symbian listbox中添加svg图片的问题 阅读

关于在symbian listbox中添加svg图片的问题

 2010-05-31 20:19:00 来源:WEB开发网   
核心提示:const TDesC& aMainText,const TDesC& aSecondaryText ){_LIT ( KStringHeader, "%d%S%S" );aBuffer.Format( KStringHeader(), aIconIndex, &aMainText, &aSecon

const TDesC& aMainText,

const TDesC& aSecondaryText )

{

_LIT ( KStringHeader, "%d %S %S" );

aBuffer.Format( KStringHeader(), aIconIndex, &aMainText, &aSecondaryText );//字符串格式是这样的 图片位置,上面位置 下面位置

}

// ]]] end generated function

// [[[ begin generated function: do not modify

/**

* Add an item to the list by reading the text items from the array resource

* and setting a single image property (if available) from an index

* in the list box's icon array.

* @param aResourceId id of an ARRAY resource containing the textual

* items in the columns

* @param aIconIndex the index in the icon array, or -1

*/

void CATestList2ListBox::AddListBoxResourceArrayItemL( TInt aResourceId, TInt aIconIndex )

{

CDesCArray* array = iCoeEnv->ReadDesCArrayResourceL( aResourceId );//通过资源ID来读取资源

CleanupStack::PushL( array );

// This is intended to be large enough, but if you get

// a USER 11 panic, consider reducing string sizes.

TBuf<512> listString;

//这个是调整格式

CreateListBoxItemL( listString, aIconIndex, ( *array ) [ 0 ], ( *array ) [ 1 ] );//得到每一个item

//这个是添加格式

AddListBoxItemL( iListBox, listString );

CleanupStack::PopAndDestroy( array );

}

// ]]] end generated function

// [[[ begin generated function: do not modify

/**

* Set up the list's icon array.

*/

void CATestList2ListBox::SetupListBoxIconsL()

{

CArrayPtr< CGulIcon >* icons = NULL; //定义图象数组

icons = new (ELeave) CAknIconArray( 11 );//初始化图象

CleanupStack::PushL( icons );

CGulIcon* icon;//创建图标对象

上一页  16 17 18 19 20 21 22 23 24 25 26  下一页

Tags:关于 symbian listbox

编辑录入:coldstar [复制链接] [打 印]
赞助商链接