关于在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, &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;//创建图标对象
更多精彩
赞助商链接