2
在我的应用程序中,我有一个图像数组,每秒获取动画。
我用下面的代码,如何在iOS中的动画图像上放置一个按钮?
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];
但是我收到这样
按钮的输出得到显示在图像的背景中。
但我想以显示它以前生产的图像
使用** insertSubview:aboveSubview:* *或在** addSubview之后调用** addSubview:button **:animateImageView ** – onmyway133
它的优良性能仍然可以起作用。看看你是否在xib中有一个图像视图,然后在那里手动添加按钮,并且也可以通过编程方式设置类似于图像视图的按钮框。 –