本文整理汇总了C++中CAListViewCell::setColor方法的典型用法代码示例。如果您正苦于以下问题:C++ CAListViewCell::setColor方法的具体用法?C++ CAListViewCell::setColor怎么用?C++ CAListViewCell::setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAListViewCell
的用法示例。
在下文中一共展示了CAListViewCell::setColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: listViewCellAtIndex
CAListViewCell* SessionsViewController::listViewCellAtIndex(CAListView *listView, const DSize& cellSize, unsigned int index)
{
CAListViewCell* cell = NULL;
if (listView->getTag() == 1)
{
DSize _size = cellSize;
cell = (CAListViewCell*)listView->dequeueReusableCellWithIdentifier("ListViewCell");
if (!cell)
{
cell = CAListViewCell::create("ListViewCell");
cell->setColor(ccc4(0xEB, 0xEB, 0xEB, 0xff));
CALabel* test = CALabel::createWithCenter(DRect(_size.width/2,
_size.height/2,
_size.width,
_size.height));
test->setTextAlignment(CATextAlignmentCenter);
test->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
test->setFontSize((28));
test->setTag(100);
CAScale9ImageView* sView = CAScale9ImageView::createWithImage(CAImage::create("common/gray_bg.png"));
sView->setFrame(DRect((0), (0), _size.width, _size.height));
cell->setBackgroundView(sView);
cell->addSubview(test);
}
CALabel* test = (CALabel*)cell->getSubviewByTag(100);
if (m_timeTblId == index)
test->setColor(CAColor_white); // ccc4(0x96, 0x96, 0x96, 255)
else
test->setColor(SAP_GRAY);
if (index == 0)
{
test->setText("All");
}
else
{
test->setText(crossapp_format_string("%2d:00", index + 8));
}
}
/*
else if(listView->getTag() == 2)
{
DSize _size = cellSize;
cell = (CAListViewCell*)listView->dequeueReusableCellWithIdentifier("ListViewCell");
if (!cell)
{
cell = CAListViewCell::create("ListViewCell");
CAButton* button = CAButton::createWithFrame(DRect((20), (20), (120), (40)), CAButtonTypeCustom);
CAScale9ImageView* sView = CAScale9ImageView::createWithFrame(DRect((0), (0), (120), (40)));
sView->setImage(CAImage::create("common/seggreen_bg.png"));
sView->setTouchEnabled(false);
button->addSubview(sView);
//button->setBackgroundViewForState(CAControlStateAll, sView);
sView = CAScale9ImageView::createWithFrame(DRect((0), (0), (120), (40)));
sView->setImage(CAImage::create("common/seggreen_bg.png"));
sView->setColor(ccc4(0x86, 0xBD, 0x45, 0xff));
button->setBackgroundViewForState(CAControlStateSelected, sView);
button->setTitleForState(CAControlStateAll, filterItem[index * 2]);
button->setTitleColorForState(CAControlStateAll, ccc4(0xA0, 0xA0, 0xA0, 0xA0));
button->setTitleFontSize((20));
button->setAllowsSelected(true);
button->addTarget(this, CAControl_selector(SessionsViewController::buttonCallBack), CAControlEventTouchUpInSide);
button->setTag(310 + index * 2);
//m_listButton[index * 2] = button;
cell->addSubview(button);
button = CAButton::createWithFrame(DRect((20), (70), (120), (40)), CAButtonTypeCustom);
sView = CAScale9ImageView::createWithFrame(DRect((0), (0), (120), (40)));
sView->setImage(CAImage::create("common/seggreen_bg.png"));
sView->setTouchEnabled(false);
button->addSubview(sView);
//button->setBackgroundViewForState(CAControlStateAll, sView);
//button->addSubview(sView);
//button->setBackgroundViewForState(CAControlStateAll, sView);
sView = CAScale9ImageView::createWithFrame(DRect((0), (0), (120), (40)));
sView->setImage(CAImage::create("common/btn_round.png"));
sView->setColor(ccc4(0x86, 0xBD, 0x45, 0xff));
button->setBackgroundViewForState(CAControlStateSelected, sView);
button->setTitleForState(CAControlStateAll, filterItem[index * 2 + 1]);
button->setTitleColorForState(CAControlStateAll, CAColor_gray);
button->setTitleFontSize((20));
button->setAllowsSelected(true);
button->addTarget(this, CAControl_selector(SessionsViewController::buttonCallBack), CAControlEventTouchUpInSide);
button->setTag(310 + index * 2 + 1);
//m_listButton[index * 2 + 1] = button;
cell->addSubview(button);
//sView = CAScale9ImageView::createWithImage(CAImage::create("common/gray_bg.png"));
//sView->setFrame(DRect((0), (0), _size.width, _size.height));
//sView->setColor(CAColor_clear);
//cell->setAlpha(0);
//cell->setBackgroundView(sView);
}
}*/
return cell;
}