0
我有一個UISwipeGestureRecognizer
的問題,找不到解決方案。UISwipeGestureRecognizer的視圖的一半
我只想在視圖的一半上使用UISwipeGestureRecognizer
。但我也想在我的視圖上使用按鈕。
這是我做的。
我有一個UIView
名爲firstView
它是768 x 1024像素與按鈕。
現在,我想在一個名爲secondView
的firstView
頂部是768×512像素添加UIView
或UIImageView
。
刷卡將工作,但我的按鈕secondView
(按鈕在firstView
)將無法正常工作。
我錯過了什麼功能讓這兩個視圖響應?
還是有比我上面描述的更好的方法嗎?
我刷卡代碼:
UIImageView *secondView = [[[UIImageView alloc] initWithFrame:
CGRectMake(0,0,768,512)] autorelease];
//UIView *secondView = [[[UIView alloc] initWithFrame:CGRectMake(0,0,768,512)] autorelease];
secondView.userInteractionEnabled = YES;
[firstView addSubview:secondView];
oneFingerSwipeLeft = [[[UISwipeGestureRecognizer alloc] initWithTarget:self
action:@selector(swipeRecognition:)] autorelease];
[oneFingerSwipeLeft setDirection:UISwipeGestureRecognizerDirectionLeft];
[secondView addGestureRecognizer:oneFingerSwipeLeft];