Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/44.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 从右向左设置图像动画或移动图像_Iphone_Objective C_Ipad - Fatal编程技术网

Iphone 从右向左设置图像动画或移动图像

Iphone 从右向左设置图像动画或移动图像,iphone,objective-c,ipad,Iphone,Objective C,Ipad,我写这段代码是为了将图像从左向右移动,它工作得很好。 但是,现在我想从右到左做这个 [UIView animateWithDuration:20.0 delay:0.0 options: UIViewAnimationOptionAllowUserInteraction + UIViewAnimationOptionRepeat +UIViewAnimationOptionCurveLinear animations:^{imageView.frame = CGRectMake(x, 0, 12

我写这段代码是为了将图像从左向右移动,它工作得很好。 但是,现在我想从右到左做这个

[UIView animateWithDuration:20.0
delay:0.0
options: UIViewAnimationOptionAllowUserInteraction + UIViewAnimationOptionRepeat +UIViewAnimationOptionCurveLinear
animations:^{imageView.frame = CGRectMake(x, 0, 12000, 768); 
}
completion:nil];
请帮帮我。
谢谢。

更改图像视图框的X坐标

下面使用

[UIView animateWithDuration:20.0
delay:0.0
options: UIViewAnimationOptionAllowUserInteraction + UIViewAnimationOptionRepeat +UIViewAnimationOptionCurveLinear
animations:^{imageView.frame = CGRectMake(0, 0, 12000, 768); 
}
completion:nil];

有趣的提示:你也可以做如下的CGRect:(CGRect){.origin.x=0,.size.width=12000,.size.height=768}whee@安德鲁·普利奥特:我已经在回答中提到了同样的CGRect:)我只是一个C99迷,好吧。