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


C++ CAScale9ImageView::addSubview方法代码示例

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


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

示例1: viewDidLoad

void NoticeDetailViewController::viewDidLoad()
{
    // Do any additional setup after loading the view from its nib.
    m_winSize = this->getView()->getBounds().size;
    
    CAScale9ImageView* sView = CAScale9ImageView::createWithImage(CAImage::create("common/sky_bg.png"));
    sView->setFrame(DRect((0), (0), m_winSize.width, (120)));
    this->getView()->addSubview(sView);
    
    CAButton* button = CAButton::createWithFrame(DRect((0), (20), (100), (100)), CAButtonTypeCustom);
    CAImageView* imageView = CAImageView::createWithImage(CAImage::create("common/nav_back.png"));
    imageView->setImageViewScaleType(CAImageViewScaleTypeFitImageXY);
    imageView->setFrame(DRect((20), (20), (80), (80)));
    button->setBackgroundViewForState(CAControlStateAll, imageView);
    button->addTarget(this, CAControl_selector(NoticeDetailViewController::buttonCallBack), CAControlEventTouchUpInSide);
    button->setTag(20);
    sView->addSubview(button);
    
    CALabel* label = CALabel::createWithCenter(DRect(m_winSize.width / 2, (70), m_winSize.width, (50)));
    label->setTextAlignment(CATextAlignmentCenter);
    label->setColor(CAColor_white);
    label->setTouchEnabled(false);
    label->setFontSize((40));
    label->setText("Notice");
    label->setFontName(SAP_FONT_ARIAL);
    sView->addSubview(label);
    
    label = CALabel::createWithFrame(DRect(0, (200), m_winSize.width, (60)));
    label->setTextAlignment(CATextAlignmentCenter);
    label->setColor(CAColor_gray);
    label->setTouchEnabled(false);
    label->setFontSize((40));
    label->setText(m_title);
    label->setFontName(SAP_FONT_ARIAL);
    this->getView()->addSubview(label);
    
    label = CALabel::createWithFrame(DRect(40, (300), m_winSize.width - 80, (800)));
    label->setTextAlignment(CATextAlignmentLeft);
    label->setColor(CAColor_gray);
    label->setTouchEnabled(false);
    label->setFontSize((30));
    label->setText(m_detail);
    label->setFontName(SAP_FONT_ARIAL);
    this->getView()->addSubview(label);
    
    CCLog("%f", CAApplication::getApplication()->getWinSize().width);
}
开发者ID:DreamCastleShanghai,项目名称:client_new,代码行数:47,代码来源:NoticeDetailViewController.cpp

示例2: viewDidLoad

void SessionsViewController::viewDidLoad()
{
    // Do any additional setup after loading the view from its nib.
    m_winSize = this->getView()->getBounds().size;
    
    CAScale9ImageView* sView = CAScale9ImageView::createWithImage(CAImage::create("common/sky_bg.png"));
    sView->setFrame(DRect((0), (0), m_winSize.width, (120)));
    this->getView()->addSubview(sView);
    
    CAButton* button = CAButton::createWithFrame(DRect((0), (20), (100), (100)), CAButtonTypeCustom);
    CAImageView* imageView = CAImageView::createWithImage(CAImage::create("common/nav_search.png"));
    imageView->setImageViewScaleType(CAImageViewScaleTypeFitImageXY);
    button->setBackgroundViewForState(CAControlStateAll, imageView);
    button->addTarget(this, CAControl_selector(SessionsViewController::buttonCallBack), CAControlEventTouchUpInSide);
    button->setTag(20);
    this->getView()->addSubview(button);
    
    FSegmentView* seg = FSegmentView::createWithFrame(DRect(m_winSize.width - 240, 45, 200, 50), 2);
    seg->addTarget(this, CAControl_selector(SessionsViewController::buttonCallBack), CAControlEventTouchUpInSide);
    imageView = CAImageView::createWithImage(CAImage::create("common/nav_time.png"));
    seg->setItemBackgroundImage(imageView, 0);
    imageView = CAImageView::createWithImage(CAImage::create("common/nav_type.png"));
    seg->setItemBackgroundImage(imageView, 1);
    seg->setTag(200, 0);
    seg->setTag(201, 1);
    this->getView()->addSubview(seg);

    m_navType = 0;
    m_navTimeType = 0;
    m_navFormatType = 0;
    
    CALabel* label = CALabel::createWithCenter(DRect(m_winSize.width / 2, (75), m_winSize.width, (50)));
    label->setTextAlignment(CATextAlignmentCenter);
    label->setColor(CAColor_white);
    label->setFontSize(SAP_TITLE_FONT_SIZE);
    label->setText("Agenda");
    label->setFontName(SAP_FONT_ARIAL);
    sView->addSubview(label);
    
    if (m_msg->empty())
    {
        requestMsg();
        {
            p_pLoading = CAActivityIndicatorView::createWithCenter(DRect(m_winSize.width / 2, m_winSize.height / 2, 50, 50));
            this->getView()->insertSubview(p_pLoading, CAWindowZOderTop);
            p_pLoading->setLoadingMinTime(0.5f);
            p_pLoading->setTargetOnCancel(this, callfunc_selector(SessionsViewController::initMsgTableView));
        }
    }
    else
    {
        initMsgTableView();
    }
    CCLog("%f", CAApplication::getApplication()->getWinSize().width);
}
开发者ID:DreamCastleShanghai,项目名称:client_new,代码行数:55,代码来源:SessionsViewController.cpp

示例3: viewDidLoad

void SessionsViewController::viewDidLoad()
{
    // Do any additional setup after loading the view from its nib.
    m_winSize = this->getView()->getBounds().size;
    
    CAScale9ImageView* sView = CAScale9ImageView::createWithImage(CAImage::create("common/sky_bg.png"));
    sView->setFrame(DRect(_px(0), _px(0), m_winSize.width, _px(120)));
    this->getView()->addSubview(sView);
    
    CAButton* button = CAButton::createWithFrame(DRect(_px(20), _px(20), _px(100), _px(100)), CAButtonTypeCustom);
    CAImageView* imageView = CAImageView::createWithImage(CAImage::create("main/nav_notification.png"));
    imageView->setImageViewScaleType(CAImageViewScaleTypeFitImageXY);
    button->setBackGroundViewForState(CAControlStateAll, imageView);
    button->addTarget(this, CAControl_selector(SessionsViewController::buttonCallBack), CAControlEventTouchUpInSide);
    button->setTag(20);
    this->getView()->addSubview(button);
    
    m_timeNoticeImageView = CAImageView::createWithFrame(DRect(_px(60), _px(30), _px(10), _px(10)));
    m_timeNoticeImageView->setImage(CAImage::create("common/reddot.png"));
    button->addSubview(m_timeNoticeImageView);
    
    button = CAButton::createWithFrame(DRect(m_winSize.width - _px(120), _px(20), _px(100), _px(100)), CAButtonTypeCustom);
    imageView = CAImageView::createWithImage(CAImage::create("main/nav_prize.png"));
    imageView->setImageViewScaleType(CAImageViewScaleTypeFitImageXY);
    button->setBackGroundViewForState(CAControlStateAll, imageView);
    button->addTarget(this, CAControl_selector(SessionsViewController::buttonCallBack), CAControlEventTouchUpInSide);
    button->setTag(30);
    this->getView()->addSubview(button);
    
    CALabel* label = CALabel::createWithCenter(DRect(m_winSize.width / 2, _px(70), m_winSize.width, _px(40)));
    label->setTextAlignment(CATextAlignmentCenter);
    label->setColor(CAColor_white);
    label->setFontSize(_px(40));
    label->setText("Agenda");
    label->setFontName("fonts/arial.ttf");
    sView->addSubview(label);

    if (m_msg.empty())
    {
        requestMsg();
    }
    else
    {
        this->initMsgTableView();
    }
    
    CCLog("%f", CAApplication::getApplication()->getWinSize().width);
}
开发者ID:DreamCastleShanghai,项目名称:client_new,代码行数:48,代码来源:VoteViewController.cpp

示例4: viewDidLoad

void MainViewController::viewDidLoad()
{
    // Do any additional setup after loading the view from its nib.
    m_winSize = this->getView()->getBounds().size;
    
    // header
    CAScale9ImageView* header = CAScale9ImageView::createWithImage(CAImage::create("common/sky_bg.png"));
    if (header) {
        header->setFrame(DRect((0), (0), m_winSize.width, (120)));
        header->setTouchEnabled(false);
        this->getView()->addSubview(header);
        
        // title lable
        CALabel* label = CALabel::createWithCenter(DRect(m_winSize.width / 2, (80), m_winSize.width, (50)));
        if (label) {
            label->setTextAlignment(CATextAlignmentCenter);
            label->setColor(CAColor_white);
            label->setFontSize(SAP_TITLE_FONT_SIZE);
            label->setText("SAP d-kom");
            label->setFontName(SAP_FONT_ARIAL);
            label->setTouchEnabled(false);
            header->addSubview(label);
        }
    }

    // left notification button
    CAButton* button = CAButton::createWithFrame(DRect((0), (20), (100), (100)), CAButtonTypeCustom);
    if (button) {
        button->addTarget(this, CAControl_selector(MainViewController::buttonCallBack), CAControlEventTouchUpInSide);
        button->setTag(20);
        this->getView()->addSubview(button);
        
        CAImageView* imageView = CAImageView::createWithImage(CAImage::create("main/nav_notification.png"));
        if (imageView) {
            imageView->setImageViewScaleType(CAImageViewScaleTypeFitImageXY);
            button->setBackGroundViewForState(CAControlStateAll, imageView);
        }
        
        m_timeNoticeImageView = CAImageView::createWithFrame(DRect((60), (30), (20), (20)));
        if (m_timeNoticeImageView) {
            m_timeNoticeImageView->setImage(CAImage::create("common/reddot.png"));
            button->addSubview(m_timeNoticeImageView);
        }
        //refreshNoticeRedPoint();
    }
    
    // notification alert point

    /*
    // right survey button
	button = CAButton::createWithFrame(DRect(m_winSize.width - (100), (20), (100), (100)), CAButtonTypeCustom);
    if (button) {
        button->addTarget(this, CAControl_selector(MainViewController::buttonCallBack), CAControlEventTouchUpInSide);
        button->setTag(30);
        this->getView()->addSubview(button);
        
        CAImageView* imageView = CAImageView::createWithImage(CAImage::create("main/nav_survey.png"));
        if (imageView) {
            imageView->setImageViewScaleType(CAImageViewScaleTypeFitImageXY);
            button->setBackgroundViewForState(CAControlStateAll, imageView);
        }
    }
    
    // survey lable
    CALabel * surveylable = CALabel::createWithFrame(DRect(m_winSize.width - (75), (100), (100), (25)));
    if (surveylable) {
        surveylable->setTextAlignment(CATextAlignmentLeft);
        surveylable->setColor(CAColor_white);
        surveylable->setFontSize(15);
        surveylable->setText("Survey");
        surveylable->setFontName(SAP_FONT_ARIAL);
        surveylable->setTouchEnabled(false);
        this->getView()->addSubview(surveylable);
    }
     */
	
    int pageViewHeight = m_winSize.height * 0.3;
    int butViewHeight = m_winSize.height * 0.15;
    int headerHeight = (120);
    int buttitleHeight = (40);
    
    /*
    // Page view
    if (!m_pageView)
    {
        m_pageView = CAPageView::createWithFrame(DRect(0, headerHeight, m_winSize.width, pageViewHeight), CAPageViewDirectionHorizontal);
        if (m_pageView) {
            m_pageView->setPageViewDelegate(this);
            m_pageView->setTouchEnabled(true);
            
             CAVector<CAView* > viewList;
             for (int i = 0; i<m_page.size(); i++)
             {
             CommonUrlImageView* temImage = CommonUrlImageView::createWithFrame(DRect(0, (0), m_winSize.width, pageViewHeight - headerHeight));
             temImage->setImageViewScaleType(CAImageViewScaleTypeFitImageCrop);
             temImage->setImage(CAImage::create("common/bg.png"));
             temImage->setUrl(m_page[i].m_imageUrl);
             temImage->setTouchEnabled(false);
             viewList.pushBack(temImage);
             }
//.........这里部分代码省略.........
开发者ID:DreamCastleShanghai,项目名称:client_new,代码行数:101,代码来源:MainViewController.cpp


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