如何在动画图像上放置文本

时间:2013-10-04 07:17:26

标签: objective-c

如何在动态图像上放置文字或标签。因此,如果移动或动画图像,图像上的文本也应该移动。请帮忙

1 个答案:

答案 0 :(得分:1)

您可以将标签添加为UIImageView的子视图吗?

UIImageView *imageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"car.png"]];
[imageV setFrame:CGRectMake(0, 0, 100, 100)];

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 10)];
label.text = @"Test";

[imageV addSubview:label];

只是一个例子......