当前位置: 首页>>代码示例>>C++>>正文


C++ CATableViewCell::getSubviewByTag方法代码示例

本文整理汇总了C++中CATableViewCell::getSubviewByTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CATableViewCell::getSubviewByTag方法的具体用法?C++ CATableViewCell::getSubviewByTag怎么用?C++ CATableViewCell::getSubviewByTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CATableViewCell的用法示例。


在下文中一共展示了CATableViewCell::getSubviewByTag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: tableCellAtIndex

CATableViewCell* MenuViewController::tableCellAtIndex(CATableView* table, const DSize& cellSize, unsigned int section, unsigned int row)
{
    DSize _size = cellSize;
    CATableViewCell* cell = table->dequeueReusableCellWithIdentifier("CrossApp");
    if (cell == NULL)
    {
        cell = CATableViewCell::create("CrossApp");
        cell->setBackgroundView(NULL);
        CALabel* test = CALabel::createWithCenter(DRect(_size.width/2+30,
                                                            _size.height/2,
                                                            _size.width,
                                                            _size.height));
        test->setTextAlignment(CATextAlignmentLeft);
        test->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
        test->setFontSize(_px(32));
		test->setColor(CAColor_white);
        test->setTag(100);
        cell->addSubview(test);
        
        CAImageView* arrow = CAImageView::createWithCenter(DRect(_size.width-64,_size.height/2,64,64));
        arrow->setTag(101);
        cell->addSubview(arrow);
    }
	CALabel* test = (CALabel*)cell->getSubviewByTag(100);
	test->setText(unicode_to_utf8(menuList[row]));// menuList[row]);
    CAImageView* arrow = (CAImageView*)cell->getSubviewByTag(101);
    arrow->setImage(CAImage::create("source_material/cell_btn_right.png"));

    return cell;
}
开发者ID:bazhi,项目名称:CrossApp,代码行数:30,代码来源:MenuViewController.cpp

示例2: tableCellAtIndex

CATableViewCell* ExtensionsTest::tableCellAtIndex(CATableView* table, const CCSize& cellSize, unsigned int section, unsigned int row)
{
	CADipSize _size = cellSize;
	Info* p_List = (Info*)personList.getValue(row);
	CATableViewCell* cell = table->dequeueReusableCellWithIdentifier("CrossApp");
	if (cell == NULL)
	{
		cell = CATableViewCell::create("CrossApp");
		CALabel* p_Name = CALabel::createWithCenter(CADipRect(_size.width*0.1, _size.height*0.5, _size.width*0.2, _size.height));
		p_Name->setTag(NAME);
		p_Name->setText(p_List->name.c_str());
		p_Name->setFontSize(_px(30));
		p_Name->setColor(CAColor_blueStyle);
		p_Name->setTextAlignment(CATextAlignmentCenter);
		p_Name->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
		cell->addSubview(p_Name);

		CALabel* p_Num = CALabel::createWithCenter(CADipRect(_size.width*0.3, _size.height*0.5, _size.width*0.2, _size.height));
		p_Num->setTag(NUM);
		p_Num->setText(p_List->num.c_str());
		p_Num->setFontSize(_px(30));
		p_Num->setColor(CAColor_blueStyle);
		p_Num->setTextAlignment(CATextAlignmentCenter);
		p_Num->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
		cell->addSubview(p_Num);

		CALabel* p_Gender = CALabel::createWithCenter(CADipRect(_size.width*0.5, _size.height*0.5, _size.width*0.2, _size.height));
		p_Gender->setTag(GENDER);
		p_Gender->setText(p_List->gender.c_str());
		p_Gender->setFontSize(_px(30));
		p_Gender->setColor(CAColor_blueStyle);
		p_Gender->setTextAlignment(CATextAlignmentCenter);
		p_Gender->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
		cell->addSubview(p_Gender);

		CALabel* p_Occupation = CALabel::createWithCenter(CADipRect(_size.width*0.8, _size.height*0.5, _size.width*0.3, _size.height));
		p_Occupation->setTag(OCCUPATION);
		p_Occupation->setText(p_List->occupation.c_str());
		p_Occupation->setFontSize(_px(30));
		p_Occupation->setColor(CAColor_blueStyle);
		p_Occupation->setTextAlignment(CATextAlignmentCenter);
		p_Occupation->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
		cell->addSubview(p_Occupation);
	}
	CALabel* p_Name = (CALabel*)cell->getSubviewByTag(NAME);
	p_Name->setText(p_List->name.c_str());
	CALabel* p_Num = (CALabel*)cell->getSubviewByTag(NUM);
	p_Num->setText(p_List->num.c_str());
	CALabel* p_Gender = (CALabel*)cell->getSubviewByTag(GENDER);
	p_Gender->setText(p_List->gender.c_str());
	CALabel* p_Occupation = (CALabel*)cell->getSubviewByTag(OCCUPATION);
	p_Occupation->setText(p_List->occupation.c_str());

	return cell;

}
开发者ID:domzhaosh,项目名称:CrossApp,代码行数:56,代码来源:ExtensionsTest.cpp

示例3: tableCellAtIndex

CATableViewCell* FirstViewController::tableCellAtIndex(CATableView* table, const CCSize& cellSize, unsigned int section, unsigned int row)
{
	CADipSize _size = cellSize;
	CATableViewCell* cell = table->dequeueReusableCellWithIdentifier("CrossApp");
	if (cell == NULL)
	{
		cell = CATableViewCell::create("CrossApp");
		CALabel* test = CALabel::createWithCenter(CADipRect(_size.width*0.5,
												_size.height*0.5,
												_size.width*0.8,
												_size.height));
		test->setColor(ccc4(51, 204, 255, 255));
		test->setTextAlignment(CATextAlignmentCenter);
		test->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
		test->setFontSize(_px(40));
		test->setTag(100);
		cell->addSubview(test);
	}
	CALabel* test = (CALabel*)cell->getSubviewByTag(100);
	test->setText(testList.at(row));
	
	return cell;
}
开发者ID:dlpc,项目名称:CrossApp,代码行数:23,代码来源:FirstViewController.cpp


注:本文中的CATableViewCell::getSubviewByTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。