gpt4 book ai didi

iphone - UILabel 中的文本可以有 colorWithPatternImage : assigned to it?

转载 作者:行者123 更新时间:2023-12-03 19:38:21 24 4
gpt4 key购买 nike

如果可以,图像可以动画吗?

有充分的理由不这样做吗?内存使用情况等?

最佳答案

是的,标签可以有图案颜色。

alt text 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 设备保持良好状态。

只要图像图 block 很小,我就没有任何理由不这样做,但我还没有对其进行广泛的分析。

关于iphone - UILabel 中的文本可以有 colorWithPatternImage : assigned to it?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1025304/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com