0

我正在做一些需要我循环浏览图像并在它们之间创建某种淡入和淡出过渡的东西。我习惯了 javascript,所以我自然会想要改变将要淡入的图像视图的深度。有没有办法选择哪个视图显示在顶部?还是有更好的方法来做我想要实现的目标?

CGRect imageFrame = CGRectMake(0.0, 0.0, 1024.0, 280.0);


UIImageView *image_one = [[UIImageView alloc] initWithFrame:imageFrame];
image_one.image = [UIImage imageNamed:@"image_one.png"];
[self.view addSubview:image_one];

UIImageView *image_two = [[UIImageView alloc] initWithFrame:imageFrame];
image_two.image = [UIImage imageNamed:@"image_two.png"];
[self.view addSubview:image_two];
4

1 回答 1

0

[UIView insertSubview:aboveSubview:]您可以从视图层次结构中删除视图,然后使用and重新插入它[UIView insertSubview:belowSubview:]

于 2012-10-03T21:14:49.210 回答