IOS-垂直向上移动多个图像
我不熟悉IOS编程。我想向上移动多个图像,使图像向上移动,然后从屏幕底部返回。因此,目前我正在成功地将一幅图像向上移动。但我不知道如何添加和向上移动多个图像 我要显示的图像名称: 图像01 图像02 图像03 图像04 图像05 图像06 这是我的密码IOS-垂直向上移动多个图像,ios,xcode,uiimageview,core-animation,Ios,Xcode,Uiimageview,Core Animation,我不熟悉IOS编程。我想向上移动多个图像,使图像向上移动,然后从屏幕底部返回。因此,目前我正在成功地将一幅图像向上移动。但我不知道如何添加和向上移动多个图像 我要显示的图像名称: 图像01 图像02 图像03 图像04 图像05 图像06 这是我的密码 - (void)viewDidLoad { [super viewDidLoad]; self.myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 560
- (void)viewDidLoad
{
[super viewDidLoad];
self.myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 560, 320, 100)];
[self.myImageView setImage:[UIImage imageNamed:@"image01.jpeg"]];
[self.view addSubview:self.myImageView];
[self setImages];
}
-(void)setImages
{
for(int i=1;i<5;i++)
{
float height = self.myImageView.center.y-0.15;
if(height<-130){
height=self.view.frame.size.height;
}
self.myImageView.center = CGPointMake (self.myImageView.center.x, height);
NSLog([NSString stringWithFormat:@"Height is %f",height]);
}
[self performSelector:@selector(setImages) withObject:nil afterDelay:0.03];
}
-(void)viewDidLoad
{
[超级视图下载];
self.myImageView=[[UIImageView alloc]initWithFrame:CGRectMake(0560320100)];
[self.myImageView setImage:[UIImage ImageName:@“image01.jpeg”];
[self.view addSubview:self.myImageView];
[自我设置图像];
}
-(无效)设置图像
{
因为(inti=1;i你完全错了
你需要:
1) 滚动视图
2) 每个图像的单独图像视图作为具有适当框架的滚动视图的子视图
3) 设置scrollView的适当内容大小
4) 通过使用动画更改scrollView的内容偏移量来滚动图像。与其再问相同的问题,我建议您使用新的详细信息编辑原始图像。我不认为您理解我的问题。我不需要在屏幕上显示滚动视图。我想用动画将所有图像上移。用户不必单击t屏幕。就像我在背景中使用这个屏幕,所以图像不断上升。