1
我需要捏合MPMoviePlayer的大小並將其在整個屏幕上移動。我已經能夠通過將玩家放入UIView並向UIView應用捏手勢來實現第一項任務。現在我需要移動視頻。任何人都知道一個可能的解提前致謝。使用拖放在屏幕上移動MPMoviePlayer
我需要捏合MPMoviePlayer的大小並將其在整個屏幕上移動。我已經能夠通過將玩家放入UIView並向UIView應用捏手勢來實現第一項任務。現在我需要移動視頻。任何人都知道一個可能的解提前致謝。使用拖放在屏幕上移動MPMoviePlayer
據我瞭解,你的問題是不動的玩家在屏幕上同時捏,但如果用戶只有一個手指觸摸屏幕上移動它。
嘗試檢查觸摸,並且只有在該事件不是多點觸摸時纔對其執行操作。
使用此gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:方法,允許幾個手勢。
- (BOOL)gestureRecognizer: (UIGestureRecognizer *) gestureRecognizer
shouldRecognizeSimultaneouslyWithGestureRecognizer:
(UIGestureRecognizer *) otherGestureRecognizer
{
if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]
|| [gestureRecognizer isKindOfClass:[UIPinchGestureRecognizer class]]
|| [otherGestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]
|| [otherGestureRecognizer isKindOfClass:[UIPinchGestureRecognizer class]])
{
return YES;
}
return NO;
}
一些幫助可能來自手勢識別器上的documentation。
嘿,非常感謝您的幫助!我不得不查看如何使用不同的手勢,因爲我相對較新的iOS應用程序開發領域。無論如何,我已經成功地平移,旋轉和縮小我的視頻播放器的大小。感覺真棒。再次感謝。 –
很高興你做了@Joel Joseph。如果有效,將問題標記爲回答:D – Kheldar