滑动图像在iphone中单击右键和左键

滑动图像在iphone中单击右键和左键,iphone,Iphone,我是IOS编程的新手,目前我有一个图像应用程序,在uiview上滑动图像。我有问题 我想在iphone中单击右按钮时向右滑动图像,单击左按钮时向左滑动图像。 我正在使用以下代码:- .h文件 #import<UIKit/UIKit.h> @interface flashViewcontroller : UIViewController<UIScrollViewDelegate> @property (nonatomic, strong) IBOutlet UIScro

我是
IOS
编程的新手,目前我有一个图像应用程序,在
uiview
上滑动图像。我有问题

我想在iphone中单击右
按钮时向右滑动图像,单击左
按钮时向左滑动图像。
我正在使用以下代码:-

.h文件

#import<UIKit/UIKit.h>

@interface flashViewcontroller : UIViewController<UIScrollViewDelegate>

@property (nonatomic, strong) IBOutlet UIScrollView *scrollView;

@property (nonatomic, strong) IBOutlet UIPageControl *pageControl;

@property (nonatomic, strong) NSArray *pageImages;

@property (nonatomic, strong) NSMutableArray *pageViews;

@property(nonatomic,strong) IBOutlet UIButton *next;

@property(nonatomic,strong) IBOutlet UIButton *previous;

-(void)loadVisiblePages;

-(void)loadPage:(NSInteger)page;

-(void)purgePage:(NSInteger)page;

-(IBAction)next:(id)sender;

-(IBAction)previos:(id)sender;

-(IBAction)skipes:(id)sender;
@end
#导入
@界面flashViewcontroller:UIViewController
@属性(非原子,强)IBUIScrollView*scrollView;
@属性(非原子,强)IBUIPageControl*pageControl;
@属性(非原子,强)NSArray*页面图像;
@属性(非原子,强)NSMutableArray*页面视图;
@属性(非原子,强)IBUIButton*next;
@属性(非原子,强)IBUIButton*previous;
-(无效)加载可视页面;
-(无效)加载页:(NSInteger)页;
-(作废)清洗页:(NSInteger)页;
-(iAction)下一步:(id)发送方;
-(iAction)previos:(id)发送方;
-(iAction)跳过:(id)发送方;
@结束
//左键单击

-(IBAction)click_LeftBtn:(id)sender{
        [imgView setFrame:CGRectMake(imgView.frame.orign.x, imgView.frame.orign.y, imgView.frame.size.width, imgView.frame.size.height)];
       [UIView beginAnimations:nil context:NULL];
       [UIView setAnimationDuration:.5];  //// Set Animationt time Duration
       [imgView setFrame:CGRectMake(0, imgView.frame.orign.y, imgView.frame.size.width, imgView.frame.size.height)];
       [UIView commitAnimations];
}
-(IBAction)click_RightBtn:(id)sender
{
        [imgView setFrame:CGRectMake(imgView.frame.orign.x, imgView.frame.orign.y, imgView.frame.size.width, imgView.frame.size.height)];
       [UIView beginAnimations:nil context:NULL];
       [UIView setAnimationDuration:.5];  //// Set Animationt time Duration
       [imgView setFrame:CGRectMake(320-imgView.frame.size.width, imgView.frame.orign.y, imgView.frame.size.width, imgView.frame.size.height)];
       [UIView commitAnimations];
}
//右键单击

-(IBAction)click_LeftBtn:(id)sender{
        [imgView setFrame:CGRectMake(imgView.frame.orign.x, imgView.frame.orign.y, imgView.frame.size.width, imgView.frame.size.height)];
       [UIView beginAnimations:nil context:NULL];
       [UIView setAnimationDuration:.5];  //// Set Animationt time Duration
       [imgView setFrame:CGRectMake(0, imgView.frame.orign.y, imgView.frame.size.width, imgView.frame.size.height)];
       [UIView commitAnimations];
}
-(IBAction)click_RightBtn:(id)sender
{
        [imgView setFrame:CGRectMake(imgView.frame.orign.x, imgView.frame.orign.y, imgView.frame.size.width, imgView.frame.size.height)];
       [UIView beginAnimations:nil context:NULL];
       [UIView setAnimationDuration:.5];  //// Set Animationt time Duration
       [imgView setFrame:CGRectMake(320-imgView.frame.size.width, imgView.frame.orign.y, imgView.frame.size.width, imgView.frame.size.height)];
       [UIView commitAnimations];
}

让我们看看你到目前为止尝试了什么?您面临的问题是什么?不需要共享.h,共享您的.m文件。