本文整理汇总了C++中CAImageView::retain方法的典型用法代码示例。如果您正苦于以下问题:C++ CAImageView::retain方法的具体用法?C++ CAImageView::retain怎么用?C++ CAImageView::retain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAImageView
的用法示例。
在下文中一共展示了CAImageView::retain方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setStyle
void CAActivityIndicatorView::setStyle(CAActivityIndicatorViewStyle style)
{
m_style = style;
if (m_style != CAActivityIndicatorViewStyleImage)
{
this->removeSubview(m_pImageView);
CC_SAFE_RELEASE(m_pImageView);
this->removeSubview(m_pBackView);
CC_SAFE_RELEASE(m_pBackView);
DRect center = getBounds();
center.origin = center.size/2;
CAImage* image = NULL;
switch (m_style)
{
case CAActivityIndicatorViewStyleGray:
{
image = CAImage::create("source_material/loading_black.png");
center.size = DSize(40, 40);
}
break;
case CAActivityIndicatorViewStyleWhite:
{
image = CAImage::create("source_material/loading_write.png");
center.size = DSize(40, 40);
} break;
case CAActivityIndicatorViewStyleGrayLarge:
{
image = CAImage::create("source_material/loading_black.png");
center.size = DSize(68, 68);
}
break;
case CAActivityIndicatorViewStyleWhiteLarge:
{
image = CAImage::create("source_material/loading_write.png");
center.size = DSize(68, 68);
}
break;
default:
break;
}
setTimesOneCycle(m_nTimesOneCycle);
CAImageView* imageView = CAImageView::createWithCenter(center);
imageView->retain();
imageView->setImage(image);
this->insertSubview(imageView, 1);
m_pImageView = imageView;
}
}