本文整理汇总了C++中CAView::insertSubview方法的典型用法代码示例。如果您正苦于以下问题:C++ CAView::insertSubview方法的具体用法?C++ CAView::insertSubview怎么用?C++ CAView::insertSubview使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAView
的用法示例。
在下文中一共展示了CAView::insertSubview方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createWithContainer
void CANavigationController::createWithContainer(CAViewController* viewController)
{
CAView* container = new CAView();
container->setFrame(this->getView()->getBounds());
this->getView()->addSubview(container);
m_pContainers.pushBack(container);
container->release();
CANavigationBar* navigationBar = CANavigationBar::create(DSize(this->getView()->getBounds().size.width, 0));
if (viewController->getNavigationBarItem() == NULL && viewController->getTitle().compare("") != 0)
{
viewController->setNavigationBarItem(CANavigationBarItem::create(viewController->getTitle()));
}
if (m_pViewControllers.empty())
{
viewController->getNavigationBarItem()->setShowGoBackButton(false);
}
navigationBar->setItem(viewController->getNavigationBarItem());
if (m_pNavigationBarBackgroundImage)
{
navigationBar->setBackgroundView(CAScale9ImageView::createWithImage(m_pNavigationBarBackgroundImage));
}
else
{
navigationBar->setBackgroundView(CAView::create());
}
navigationBar->getBackgroundView()->setColor(m_sNavigationBarBackgroundColor);
navigationBar->setTitleColor(m_sNavigationBarTitleColor);
navigationBar->setTitleColor(m_sNavigationBarTitleColor);
container->insertSubview(navigationBar, 1);
navigationBar->setDelegate(this);
m_pNavigationBars.pushBack(navigationBar);
CAView* secondContainer = new CAView();
container->addSubview(secondContainer);
secondContainer->release();
m_pSecondContainers.pushBack(secondContainer);
viewController->m_pNavigationController = this;
m_pViewControllers.pushBack(viewController);
}