如果是这样,图像可以动画化吗?
有充分的理由不这样做吗?内存使用情况等?
是的,标签可以有图案颜色。
替代文本 http://img178.imageshack.us/img178/1995/textwithpatterncolor.png
// make a UIColor with an image as the pattern
UIImage *tileImage = [UIImage imageNamed:@"hot_grad_64px.png"];
UIColor *patternColorTile = [UIColor colorWithPatternImage:tileImage];
// assign it to the .textColor property of a UILabel
self.testLabel.textColor = patternColorTile;
// the pattern will only align if both the .frame property of the
// label AND the font size is the same as the image tile height
可以通过在多种图案颜色之间切换来使图案动画化。我以 > 30fps 的速度在图案图像和纯色图像之间切换,iPhone 设备保持良好状态。
只要图像图块很小,我就没有任何理由不这样做,但我还没有对其进行广泛的分析。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)