2012/08/29

[iOS] 設定透明背景的 UIWebView

webView.opaque = NO;
[webView setBackgroundColor:[UIColor clearColor]];
[self hideGradientBackground:webView];

- (void) hideGradientBackground:(UIView*)theView
{
  for (UIView * subview in theView.subviews)
  {
    if ([subview isKindOfClass:[UIImageView class]])
      subview.hidden = YES;

    [self hideGradientBackground:subview];
  }
}
UIWebView 裡的 html 也要設定成透明背景。
<body style="background-color: transparent;">

UIImage to CCSprite

利用 UIImage 的 CGImage 屬性。
UIImage *myImg = [UIImage imageNamed:@"myImg.png"];
CGImageRef myImgRef = [myImg CGImage];
CCSprite *mySprite = [CCSprite spriteWithCGImage:myImgRef key:@"myImg.png"];

2012/08/04

[Castle Age] Armor of Redemption 入手

Armor of Redemption - 2012/08/04