【发布时间】:2013-10-27 22:49:42
【问题描述】:
我想使用一个按钮在三个不同的位置更改图像的位置... 使用我的代码,图像仅移动了一个位置...
ViewController.h
@property (weak, nonatomic) IBOutlet UIImageView *Switch3Way;
- (IBAction)Switch3WayPressed:(id)sender;
ViewController.m
- (void)Switch3WayPressed:(id)sender {
CGRect frame = Switch3Way.frame;
frame.origin.x = 323;
frame.origin.y = 262;
Switch3Way.frame = frame;
}
【问题讨论】:
-
那么你的问题是什么?该代码有效吗?你得到了什么结果?
-
使用我的代码,图像仅移动了一个位置...
-
你的意思是你的代码图像只移动到一个位置?并且要将图像移动到其他两个位置?
-
是的,在三个不同的位置...
标签: ios button uiview position