這段代碼可以幫助您創建滾動型與可拖動圖像對象,並嘗試
@interface DraggableImages : UIScrollView {
}
@implementation DraggableImages
@synthesize delegate;
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
return self;
}
//called when we touch the box
- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
// Retrieve the touch point
}
//called when we move box
- (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event {
}
//called when touch is cancelled
-(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
}
//called when touch is ended
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
}
沒有看到你的代碼 - ESP的屏幕結構 - 我只能猜測。可能該事件被不能處理觸摸的視圖所捕獲。確保所有顯示的主要元素都能捕捉到觸摸! – user387184