私はUITabBar
を持っています。各タブはタップすると色が変わります。アニメーションタブバーの色の変更
notSelectedColorとSelectedColorの間を0.5秒間アニメーション化したいのですが、どうすればいいですか?
が、私はそのような色で画像を再描画しています:
func imageWithColor(color: UIColor) -> UIImage {
UIGraphicsBeginImageContextWithOptions(size, false, scale)
let context = UIGraphicsGetCurrentContext()
CGContextTranslateCTM(context, 0.0, size.height)
CGContextScaleCTM(context, 1.0, -1.0)
CGContextSetBlendMode(context, CGBlendMode.Normal)
let rect = CGRect(origin: CGPointZero, size: size)
CGContextClipToMask(context, rect, CGImage)
color.setFill()
CGContextFillRect(context, rect)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
return newImage
}
はあなたに感謝します!
@ChiragPatelは、そこに任意の迅速な方法ではないでしょうか? –