本文整理汇总了C++中CAView::getSubviewByTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CAView::getSubviewByTag方法的具体用法?C++ CAView::getSubviewByTag怎么用?C++ CAView::getSubviewByTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAView
的用法示例。
在下文中一共展示了CAView::getSubviewByTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setSelectedAtIndex
void CATabBar::setSelectedAtIndex(int index)
{
do
{
CC_BREAK_IF(index < 0);
CC_BREAK_IF(index >= m_pItems.size());
if (m_pSelectedItem && m_pSelectedItem->getSelectedImage())
{
CAView* viewLast = m_pViews.at(m_nSelectedIndex);
if (CAImageView* imageView = dynamic_cast<CAImageView*>(viewLast->getSubviewByTag(0xffff)))
{
imageView->setImage(m_pSelectedItem->getImage());
}
}
m_nSelectedIndex = index;
m_pSelectedItem = m_pItems.at(m_nSelectedIndex);
m_pSelectedBackGround->setFrame(m_pViews.at(m_nSelectedIndex)->getFrame());
if (m_pSelectedIndicator)
{
((CCScale9Sprite*)m_pSelectedIndicator)->setPreferredSize(CCSize(m_cItemSize.width, m_cItemSize.height / 10));
m_pSelectedIndicator->stopAllActions();
CCPoint p = CCPoint(m_pSelectedBackGround->getFrame().origin.x, m_pSelectedBackGround->getFrame().size.height);
CCMoveTo* moveTo = CCMoveTo::create(0.3f, p);
CCEaseSineOut* easeBack = CCEaseSineOut::create(moveTo);
m_pSelectedIndicator->runAction(easeBack);
}
if (m_pSelectedItem->getSelectedImage())
{
CAView* view = m_pViews.at(m_nSelectedIndex);
if (CAImageView* imageView = dynamic_cast<CAImageView*>(view->getSubviewByTag(0xffff)))
{
imageView->setImage(m_pSelectedItem->getSelectedImage());
}
}
m_pDelegate->tabBarSelectedItem(this, m_pSelectedItem, m_nSelectedIndex);
}
while (0);
}