我想制作一个按钮,将我的图像向上移动一帧高度,如果再次按下按钮,将图像向下移动一帧高度。
http://imageshack.us/photo/my-images/140/72197925.png/ (解决方案说明)
我正在尝试使用尽可能少的代码。
UIImage *image = [UIImage imageNamed:@"01bear.png"];
imageView = [[UIImageView alloc] initWithImage:image];
CGRect applicationFrame = [[UIScreen mainScreen] applicationFrame];
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:applicationFrame];
scrollView.contentSize = CGSizeMake(5760, 1);
[scrollView addSubview:imageView];
[window addSubview:scrollView];
[window makeKeyAndVisible];
scrollView.delegate = self;
scrollView.pagingEnabled = YES;