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


C++ CALabel::setFontSize方法代码示例

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


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

示例1: initWithCell

void FSBookReadTimesCell::initWithCell()
{
    
    CADipSize _size = this->getBounds().size;
//    CAView *view = CAView::createWithFrame(this->getBounds());
//    view->setTag(99);
//    this->addSubview(view);
    
    CAImageView* itemImage = CAImageView::createWithFrame(CADipRect(LEFTSPACE, TOPSPACE, (_size.height-TOPSPACE-BOTTOMSPACE)*3/4, _size.height-TOPSPACE-BOTTOMSPACE));
    itemImage->setTag(99);
    this->addSubview(itemImage);
    
//    CADipSize itemSize = itemImage->getBounds().size;
//    CALabel* itemText = CALabel::createWithCenter(CADipRect(itemSize.width*0.5, itemSize.height+20, 150, 40));
//    itemText->setTag(100);
//    itemText->setFontSize(_px(29));
//    itemText->setTextAlignment(CATextAlignmentCenter);
//    itemText->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
//    itemImage->addSubview(itemText);
    
    
    CALabel *textTitle = CALabel::createWithFrame(CADipRect(itemImage->getFrame().size.width+LEFTSPACE*2, TOPSPACE, _size.width-itemImage->getFrame().size.width-LEFTSPACE*2, (_size.height-TOPSPACE-BOTTOMSPACE)/2));
    
    textTitle->setTag(100);
        textTitle->setFontSize(_px(29));
        textTitle->setTextAlignment(CATextAlignmentLeft);
        textTitle->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
//        textTitle->setColor(ccc4(100,100,100,1));
    this->addSubview(textTitle);
    
    
    CALabel *authorTitle = CALabel::createWithFrame(CADipRect(itemImage->getFrame().size.width+LEFTSPACE*2, TOPSPACE+(_size.height-TOPSPACE-BOTTOMSPACE)/2, _size.width-itemImage->getFrame().size.width-LEFTSPACE-LEFTSPACE, (_size.height-TOPSPACE-BOTTOMSPACE)/2));
    authorTitle->setTag(101);
    authorTitle->setFontSize(_px(29));
    authorTitle->setTextAlignment(CATextAlignmentLeft);
    authorTitle->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
    this->addSubview(authorTitle);
    
//    CADipSize m_size = this->getFrame().size;
//    CALabel* cellText = CALabel::createWithCenter(CADipRect(m_size.width*0.1, m_size.height*0.5, m_size.width*0.3, m_size.height*0.8));
//    cellText->setTag(100);
//    cellText->setFontSize(_px(30));
//    cellText->setTextAlignment(CATextAlignmentCenter);
//    cellText->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
//    this->addSubview(cellText);
    
//    CAButton* btnOnCell = CAButton::createWithCenter(CADipRect(m_size.width*0.85, m_size.height*0.5, m_size.width*0.2, m_size.height*0.7), CAButtonTypeRoundedRect);
//    btnOnCell->setTag(102);
//    btnOnCell->setTitleForState(CAControlStateAll, "Touch");
//    btnOnCell->addTarget(this, CAControl_selector(FSBookReadTimesCell::cellBtnCallback), CAControlEventTouchUpInSide);
//    this->addSubview(btnOnCell);
}
开发者ID:fx0883,项目名称:HighMessage,代码行数:52,代码来源:FSBookReadTimesCell.cpp

示例2: buttonBackground

void ButtonTest::buttonBackground()
{
	CALabel* buttonImage = CALabel::createWithCenter(CCRect(size.width*0.5, size.height*0.3, size.width*0.4, 50));
	buttonImage->setText("ButtonImage");
	buttonImage->setFontSize(30 * CROSSAPP_ADPTATION_RATIO);
	buttonImage->setTextAlignment(CATextAlignmentCenter);
	buttonImage->setColor(ccc4(51, 204, 255, 255));
	this->getView()->addSubview(buttonImage);

	CAButton* defaultBtn = CAButton::create(CAButtonTypeCustom);
	defaultBtn->setCenter(CCRect(size.width*0.25 - 50, size.height*0.4, size.width*0.2, size.height*0.05));
	defaultBtn->setTitleForState(CAControlStateNormal, "Normal");
	defaultBtn->setTitleForState(CAControlStateSelected,"Selected");
	defaultBtn->setTitleForState(CAControlStateHighlighted, "Highlighted");
	defaultBtn->setBackGroundViewForState(CAControlStateNormal,CAView::createWithColor(CAColor_green));
	defaultBtn->setBackGroundViewForState(CAControlStateHighlighted, CAView::createWithColor(CAColor_yellow));
	defaultBtn->setTitleColorForState(CAControlStateAll, ccc4(51, 204, 255, 255));
	this->getView()->addSubview(defaultBtn);

	CALabel* custom = CALabel::createWithCenter(CCRect(size.width*0.25 - 50, size.height*0.4 + 80, size.width*0.2, 50));
	custom->setText("(BackgroundView)");
	custom->setFontSize(20 * CROSSAPP_ADPTATION_RATIO);
	custom->setTextAlignment(CATextAlignmentCenter);
	custom->setColor(ccc4(51, 204, 255, 255));
	this->getView()->addSubview(custom);


	CAButton* squareRectBtn = CAButton::create(CAButtonTypeSquareRect);
	squareRectBtn->setCenter(CCRect(size.width*0.5, size.height*0.4, size.width*0.2, size.height*0.05));
	squareRectBtn->setImageForState(CAControlStateNormal,CAImage::create("square_nor.png"));
	squareRectBtn->setImageForState(CAControlStateHighlighted, CAImage::create("square_sel.png"));
	this->getView()->addSubview(squareRectBtn);

	CALabel* square = CALabel::createWithCenter(CCRect(size.width*0.5, size.height*0.4 + 80, size.width*0.2, 50));
	square->setText("(StateImage)");
	square->setFontSize(20 * CROSSAPP_ADPTATION_RATIO);
	square->setTextAlignment(CATextAlignmentCenter);
	square->setColor(ccc4(51, 204, 255, 255));
	this->getView()->addSubview(square);

	CAButton* roundedRectBtn = CAButton::create(CAButtonTypeRoundedRect);
	roundedRectBtn->setCenter(CCRect(size.width*0.75 + 50, size.height*0.4, size.width*0.2, size.height*0.05));
	roundedRectBtn->setControlState(CAControlStateDisabled);
	this->getView()->addSubview(roundedRectBtn);

	CALabel* rounded = CALabel::createWithCenter(CCRect(size.width*0.75 + 50, size.height*0.4 + 80, size.width*0.2, 50));
	rounded->setText("(Disabled)");
	rounded->setFontSize(20 * CROSSAPP_ADPTATION_RATIO);
	rounded->setTextAlignment(CATextAlignmentCenter);
	rounded->setColor(ccc4(51, 204, 255, 255));
	this->getView()->addSubview(rounded);
}
开发者ID:AojiaoZero,项目名称:CrossApp,代码行数:52,代码来源:ButtonTest.cpp

示例3: initWithCell

void CDNewsImageTableCell::initWithCell(int num)
{
    cell_tag = CCRANDOM_0_1()*4+1;
    DSize _size = this->getFrame().size;
    CALabel* test = CALabel::createWithFrame(DRect(40,
                                                       _size.height-150,
                                                       _size.width-90,
                                                       40));
	test->setColor(CAColor_black);
    test->setTextAlignment(CATextAlignmentLeft);
    test->setVerticalTextAlignmet(CAVerticalTextAlignmentTop);
    test->setFontSize(32);
    test->setBold(true);
    test->setTag(100);
    this->addSubview(test);
    
    CALabel* dsc = CALabel::createWithFrame(DRect(40,
                                                      _size.height-90,
                                                      _size.width-90,
                                                      70));
	dsc->setColor(CAColor_black);
    dsc->setTextAlignment(CATextAlignmentLeft);
    dsc->setVerticalTextAlignmet(CAVerticalTextAlignmentTop);
    dsc->setFontSize(26);

    dsc->setTag(101);
	dsc->setColor(ccc4(200, 200, 200, 255));
    this->addSubview(dsc);
    
    CommonUrlImageView* temImage = CommonUrlImageView::createWithFrame(DRect(0,5,_size.width,_size.height-180));
    temImage->setTag(200);
    temImage->setImageViewScaleType(CAImageViewScaleTypeFitImageCrop);
    
    CommonUrlImageView* temImage1 = CommonUrlImageView::createWithFrame(DRect(0,5,_size.width,_size.height-180));
    temImage1->setTag(201);
    temImage1->setImageViewScaleType(CAImageViewScaleTypeFitImageCrop);
    
    CommonUrlImageView* temImage2 = CommonUrlImageView::createWithFrame(DRect(0,5,_size.width,_size.height-180));
    temImage2->setTag(202);
    temImage2->setImageViewScaleType(CAImageViewScaleTypeFitImageCrop);
    
    CommonUrlImageView* temImage3 = CommonUrlImageView::createWithFrame(DRect(0,5,_size.width,_size.height-180));
    temImage3->setTag(203);
    temImage3->setImageViewScaleType(CAImageViewScaleTypeFitImageCrop);
    
    this->addSubview(temImage);
    this->addSubview(temImage1);
    this->addSubview(temImage2);
    this->addSubview(temImage3);
}
开发者ID:jtly1985,项目名称:CrossApp,代码行数:50,代码来源:CDNewsImageController.cpp

示例4: tableViewSectionViewForHeaderInSection

CAView* SecondViewController::tableViewSectionViewForHeaderInSection(CATableView* table, const CCSize& viewSize, unsigned int section)
{
	CADipSize _viewSize = viewSize;
	char head[10] = "";
	CAView* view = CAView::createWithColor(ccc4(239,242,243,255));
	CAButton* headControl1 = CAButton::createWithCenter(CADipRect(60, _viewSize.height*0.5, 80, 80),
		CAButtonTypeRoundedRect);
	headControl1->setTag(100 + (int)section);
	if (sect[section] == CELL_COUNT)
	{
		headControl1->setBackGroundViewForState(CAControlStateNormal, CAImageView::createWithImage(CAImage::create("source_material/close1.png")));
	}
	else
	{
		headControl1->setBackGroundViewForState(CAControlStateNormal, CAImageView::createWithImage(CAImage::create("source_material/open1.png")));
	}
	headControl1->addTarget(this, CAControl_selector(SecondViewController::switchCellListInSection), CAControlEventTouchUpInSide);
	view->addSubview(headControl1);

	CALabel* header = CALabel::createWithCenter(CADipRect(_viewSize.width*0.5, _viewSize.height*0.5, 300, 50));
	sprintf(head, "Section-%d", section);
	header->setFontSize(_px(30));
	header->setText(head);
	header->setColor(CAColor_blueStyle);
	header->setTextAlignment(CATextAlignmentCenter);
	header->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
	view->addSubview(header);

	return view;
}
开发者ID:Brian1900,项目名称:CrossApp,代码行数:30,代码来源:SecondViewController.cpp

示例5: initPageView

/*
void MainViewController::initPageView()
{
}
*/
void MainViewController::showAlert()
{
    if (p_alertView) {
        this->getView()->removeSubview(p_alertView);
        p_alertView = NULL;
    }
    
    p_alertView = CAView::createWithFrame(DRect((0), (120), m_winSize.width, m_winSize.height - (220)));
    this->getView()->addSubview(p_alertView);
    
    CAImageView* bg = CAImageView::createWithFrame(DRect((0), (0), m_winSize.width, m_winSize.height - (220)));
    bg->setImageViewScaleType(CAImageViewScaleTypeFitImageXY);
    bg->setImage(CAImage::create("common/bg.png"));
    bg->setTouchEnabled(false);
    
    CAButton* btn5 = CAButton::create(CAButtonTypeSquareRect);
    btn5->setTag(100);
    btn5->setFrame(DRect((0), (0), m_winSize.width, m_winSize.height - (220)));
    btn5->setTitleColorForState(CAControlStateNormal, CAColor_white);
    btn5->setBackgroundViewForState(CAControlStateNormal, bg);
    btn5->setBackgroundViewForState(CAControlStateHighlighted, bg);
    btn5->addTarget(this, CAControl_selector(MainViewController::buttonCallBack), CAControlEventTouchUpInSide);
    p_alertView->addSubview(btn5);
    
    CALabel* test = CALabel::createWithFrame(DRect(0, m_winSize.height - (300), m_winSize.width, (40)));
    test->setColor(CAColor_gray);
    test->setTextAlignment(CATextAlignmentCenter);
    test->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
    test->setFontSize((30));
    test->setText("Network cannot connect!");
    p_alertView->addSubview(test);
    
}
开发者ID:DreamCastleShanghai,项目名称:client_new,代码行数:38,代码来源:MainViewController.cpp

示例6: collectionCellAtIndex

CACollectionViewCell* AutoCollectionViewHorizontalTest::collectionCellAtIndex(CAAutoCollectionView *collectionView, const DSize& cellSize, unsigned int section, unsigned int item)
{
    CACollectionViewCell* p_Cell = collectionView->dequeueReusableCellWithIdentifier("CrossApp");

    if (p_Cell == NULL)
    {
        p_Cell = CACollectionViewCell::create("CrossApp");
        
        CAView* itemImage = CAView::createWithLayout(DLayoutFill);
        itemImage->setTag(99);
        p_Cell->getContentView()->addSubview(itemImage);
        
        CALabel* itemText = CALabel::createWithLayout(DLayoutFill);
        itemText->setTag(100);
        itemText->setFontSize(29);
        itemText->setTextAlignment(CATextAlignmentCenter);
        itemText->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
        p_Cell->getContentView()->addSubview(itemText);
    }

    CAView* itemImageView = p_Cell->getContentView()->getSubviewByTag(99);
    itemImageView->setColor(HorizontalcolorArr.at(item));
    CCLog("row = %d", item);
    
    char pos[20] = "";
    sprintf(pos, "(%d,%d)", section, item);
    CALabel* itemText = (CALabel*)p_Cell->getContentView()->getSubviewByTag(100);
    itemText->setText(pos);
    return  p_Cell;
    
}
开发者ID:WoYang,项目名称:CrossApp,代码行数:31,代码来源:AutoCollectionViewHorizontalTest.cpp

示例7: 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

示例8: showAlert

void CDNewsImageController::showAlert()
{
    p_alertView = CAView::createWithFrame(this->getView()->getBounds());
    this->getView()->addSubview(p_alertView);
    
    CAImageView* bg = CAImageView::createWithFrame(DRect(0,0,winSize.width,winSize.height));
    bg->setImageViewScaleType(CAImageViewScaleTypeFitImageCrop);
    bg->setImage(CAImage::create("image/HelloWorld.png"));
    
    CAButton* btn5 = CAButton::create(CAButtonTypeSquareRect);
    btn5->setTag(100);
    btn5->setCenter(DRect(winSize.width/2, winSize.height/2, winSize.width, winSize.height));
    btn5->setTitleColorForState(CAControlStateNormal,CAColor_white);
    btn5->setBackgroundViewForState(CAControlStateNormal, bg);
    btn5->setBackgroundViewForState(CAControlStateHighlighted, bg);
    btn5->addTarget(this, CAControl_selector(CDNewsImageController::buttonCallBack), CAControlEventTouchUpInSide);
    p_alertView->addSubview(btn5);
    
    CALabel* test = CALabel::createWithCenter(DRect(winSize.width/2,
                                                        winSize.height-100,
                                                        winSize.width,
                                                        40));
	test->setColor(CAColor_gray);
    test->setTextAlignment(CATextAlignmentCenter);
    test->setVerticalTextAlignmet(CAVerticalTextAlignmentTop);
    test->setFontSize(24);
    test->setText("网络不给力,请点击屏幕重新加载~");
    p_alertView->addSubview(test);
    
}
开发者ID:jtly1985,项目名称:CrossApp,代码行数:30,代码来源:CDNewsImageController.cpp

示例9: showAlert

void SessionsViewController::showAlert()
{
    if (p_alertView) {
        this->getView()->removeSubview(p_alertView);
        p_alertView = NULL;
    }
    
    p_alertView = CAView::createWithFrame(this->getView()->getBounds());
    this->getView()->addSubview(p_alertView);
    
    CAImageView* bg = CAImageView::createWithFrame(DRect(_px(0), _px(120), m_winSize.width, m_winSize.height - _px(120)));
    bg->setImageViewScaleType(CAImageViewScaleTypeFitImageCrop);
    bg->setImage(CAImage::create("common/bg.png"));
    
    CAButton* btn5 = CAButton::create(CAButtonTypeSquareRect);
    btn5->setTag(100);
    btn5->setFrame(DRect(_px(0), _px(120), m_winSize.width, m_winSize.height - _px(120)));
    btn5->setTitleColorForState(CAControlStateNormal, CAColor_white);
    btn5->setBackGroundViewForState(CAControlStateNormal, bg);
    btn5->setBackGroundViewForState(CAControlStateHighlighted, bg);
    btn5->addTarget(this, CAControl_selector(SessionsViewController::buttonCallBack), CAControlEventTouchUpInSide);
    p_alertView->addSubview(btn5);
    
    CALabel* test = CALabel::createWithCenter(DRect(m_winSize.width / 2, (m_winSize.height - _px(120)) / 2, m_winSize.width, m_winSize.height - _px(120)));
    test->setColor(CAColor_gray);
    test->setTextAlignment(CATextAlignmentCenter);
    test->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
    test->setFontSize(_px(24));
    test->setText("Network cannot connected !");
    p_alertView->addSubview(test);

}
开发者ID:DreamCastleShanghai,项目名称:client_new,代码行数:32,代码来源:VoteViewController.cpp

示例10: toast

void UtilManager::toast(string text, CAViewController* object) {

	CAApplication::getApplication()->getRootWindow()->removeSubviewByTag(TOAST_VIEW_TAG);

	CCSize winSize = CAApplication::getApplication()->getWinSize();
	//CAView *back = CAView::createWithCenter(CCRect(winSize.width*0.5, winSize.height*0.5, _dip(winSize.width)*0.3, _dip(winSize.height)*0.3));
	CAView *back = CAView::createWithCenter(CCRect(winSize.width*0.5, winSize.height*0.5, 180 * getScale(), 30 * getScale()));
	back->setTag(TOAST_VIEW_TAG);
	back->setColor(ccc4(31, 31, 31, 200));//40

	CALabel *title = CALabel::createWithCenter(CADipRect(_dip(back->getBounds().size.width*0.5),
		_dip(back->getBounds().size.height*0.5), 180 * getScale(), 30 * getScale()));
  //	title->setText(UTF8ToGBK::transferToGbk(text));
	title->setText(text);
	//title->setText("sssss");
//	title->setFontName(getChineseFont());
	title->setColor(CAColor_white);
	title->setTextAlignment(CATextAlignmentCenter);
	title->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
	title->setFontSize(_px(15));
	back->addSubview(title);
	//CAApplication::getApplication()->getRootWindow()->getRootViewController()->getView()->addSubview(back);
	back->runAction(CCFadeOut::create(1));

	//CAApplication::getApplication()->getRootWindow()->addSubview(back);
	object->getView()->addSubview(back);
	//CCLog("%s", get_date_now().c_str());
	scheduleOnce(schedule_selector(UtilManager::removeToast), this, TOAST_TIME);
}
开发者ID:a752602882,项目名称:DotaMax,代码行数:29,代码来源:UtilManager.cpp

示例11: tableViewSectionViewForHeaderInSection

CAView* HeroInfoController::tableViewSectionViewForHeaderInSection(CATableView* table, const CCSize& viewSize, unsigned int section)
{
	CAView* _headView;
	_headView = CAView::createWithColor(COLOR_GRAY);
	CALabel* label = CALabel::createWithFrame(CCRect(10, 0, viewSize.width / 10, viewSize.height));
	label->setTextAlignment(CATextAlignmentLeft);
	label->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);

	label->setFontSize(_px(13));
	_headView->addSubview(label);
	if (section == 0)
	{
		label->setText(UTF8ToGBK::transferToGbk("摘要"));
		
	}
	else if (section ==1)
	{
		label->setText(UTF8ToGBK::transferToGbk("英雄属性"));
	}
	else if (section ==2)
	{
		label->setText(UTF8ToGBK::transferToGbk("技能介绍"));
	}
	

	return _headView;
	
}
开发者ID:a752602882,项目名称:DotaMax,代码行数:28,代码来源:HeroInfoController.cpp

示例12: viewForRowInComponent

CAView* CAPickerView::viewForRowInComponent(int component, int row, CCSize size)
{
    int index = m_componentsIndex[component][row];
    if (index == -1)
    {
        return NULL;
    }
    
    CAView* view = m_dataSource->viewForRow(this, index, component);
    if (!view)
    { // create view
        CCString* title = m_dataSource->titleForRow(this, index, component);
        if (title && title->length() > 0)
        {
            CCRect rect = CCRectMake(0, 0, size.width, size.height);
            CALabel* label = CALabel::createWithFrame(rect);
            label->setText(title->getCString());
            label->setColor(m_fontColorNormal);
            label->setFontSize(m_fontSizeNormal);
            label->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
            label->setTextAlignment(CATextAlignmentCenter);
            
            return label;
        }
    }
    
    return view;
}
开发者ID:lmxing1987,项目名称:CrossApp,代码行数:28,代码来源:CAPickerView.cpp

示例13: initWithSize

void FSBooklibraryCell::initWithSize(CADipSize& cellSize)
{
    CADipSize _size = cellSize;
    
    
    
//    itemImage = CAImageView::createWithFrame(CADipRect(0, 0, _size.width, _size.height));
//    itemImage->setTag(99);
//    this->addSubview(itemImage);
    
//    CADipSize itemSize = itemImage->getBounds().size;
//        CALabel*   itemText = CALabel::createWithCenter(CADipRect(_size.width*0.5, _size.height*0.5, 150, 40));
//    itemText->setTag(100);
//    itemText->setFontSize(_px(29));
//    itemText->setTextAlignment(CATextAlignmentCenter);
//    itemText->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
//    itemImage->addSubview(itemText);
    
    
    CAImageView* itemImage = CAImageView::createWithFrame(CADipRect(0, 0, _size.width, _size.height*4/5));
    itemImage->setTag(99);
    this->addSubview(itemImage);
    
    CADipSize itemSize = itemImage->getBounds().size;
    CALabel* itemText = CALabel::createWithCenter(CADipRect(itemSize.width*0.5, itemSize.height+20, 150, 40));
    itemText->setTag(100);
    itemText->setFontSize(_px(29));
    itemText->setTextAlignment(CATextAlignmentCenter);
    itemText->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
    itemImage->addSubview(itemText);
    
   // this->setControlCanSelected(false);
}
开发者ID:fx0883,项目名称:HighMessage,代码行数:33,代码来源:FSBooklibraryCell.cpp

示例14: listViewCellAtIndex

CAListViewCell* ListViewTest::listViewCellAtIndex(CAListView *listView, const DSize& cellSize, unsigned int index)
{
    CAListViewCell* cell = (CAListViewCell*)listView->dequeueReusableCellWithIdentifier("ListViewCell");
    if (cell==NULL)
    {
        cell = CAListViewCell::create("ListViewCell");
        
        CALabel* test = CALabel::createWithLayout(DLayout(DHorizontalLayout_L_W(0, 200), DVerticalLayoutFill));
        test->setColor(ccc4(51, 204, 255, 255));
        test->setTextAlignment(CATextAlignmentCenter);
        test->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
        test->setFontSize(28);
        test->setTag(100);
        cell->addSubview(test);
        
        CAButton* btn = CAButton::createWithLayout(DLayout(DHorizontalLayout_W_C(100, 0.85), DVerticalLayout_H_C(50, 0.5)), CAButtonTypeSquareRect);
        btn->setTitleForState(CAControlStateNormal, "btn");
        btn->setTag(200);
        cell->addSubview(btn);
        btn->setTouchEventScrollHandOverToSuperview(false);
    }
    char temptext[10];
    sprintf(temptext, "cell-%d",index);
    CALabel* test = (CALabel*)cell->getSubviewByTag(100);
    test->setText(temptext);
    
    return cell;
}
开发者ID:WoYang,项目名称:CrossApp,代码行数:28,代码来源:ListViewTest.cpp

示例15: loadDisButton

void registerViewController::loadDisButton(CCSize _size, int _lineHeight){

	
	CAButton* button1 = CAButton::createWithFrame(CCRect(-1, 10 + _lineHeight, _size.width / 5, _px(50)), CAButtonTypeCustom);
	button1->setAllowsSelected(false);
	CAScale9ImageView* imageView = CAScale9ImageView::createWithImage(CAImage::create("image/bg.png"));
	button1->setBackGroundViewForState(CAControlStateAll, imageView);
	this->getView()->addSubview(button1);

	CAView* view1 = CAView::createWithFrame(CCRect(-1, 11 + _lineHeight, _size.width / 5 - 1, _px(48)));
	view1->setColor(ccc4(220, 220, 220, 250));
	this->getView()->addSubview(view1);

	CALabel* label = CALabel::createWithCenter(view1->getCenter());
	label->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
	label->setTextAlignment(CATextAlignmentCenter);
	label->setFontSize(_px(20));
	if (_lineHeight==0)
	{
		label->setText("+86");
	}
	else{
		label->setText(UTF8("邀请码"));
	}
	this->getView()->addSubview(label);

}
开发者ID:a752602882,项目名称:DotaMax,代码行数:27,代码来源:registerViewController.cpp


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