在我的应用程序中,我有一个图像阵列,每秒都会动画一次 我使用了以下代码,
animateArrayImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"gallery-img-1.png"],
[UIImage imageNamed:@"gallery-img-2.png"],nil];
animateImageView.animationImages = animateArrayImages;
animateImageView.animationDuration = 1.0f;
animateImageView.animationRepeatCount = 0;
[animateImageView startAnimating];
UIButton *button=[UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setFrame:CGRectMake(20, 20, 20, 20)];
[self.view addSubview:button];
但我得到这样的输出
该按钮将显示在图像的背景中
但我想在图像中显示它
答案 0 :(得分:0)
如果您想将按钮置于图像顶部,可以在addSubview:
[self.view bringSubviewToFront:button];