gpt4 book ai didi

iphone - MPMoviePlayerViewController 上的向下滑动手势

转载 作者:行者123 更新时间:2023-12-03 19:37:02 27 4
gpt4 key购买 nike

我的应用程序以电影开始,我尝试向下滑动或向下滑动以继续电影,但我不知道为什么手势不起作用,我尝试使用:

[player view].userInteractionEnabled = NO;
-(void) swiped: (UISwipeGestureRecognizer *) sender {

NSLog(@"SLIDE DOWN");
NSString *path = [[NSBundle mainBundle] pathForResource:@"sahar3" ofType:@"mov"];

player = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:path]];

player.moviePlayer.scalingMode = MPMovieScalingModeFill;
player.moviePlayer.controlStyle = MPMovieControlStyleNone;

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieFinishedPlaying:)
name:MPMoviePlayerPlaybackDidFinishNotification object:[player moviePlayer]];

player.moviePlayer.repeatMode = NO;
[self.view addSubview:player.view];

}

- (void)viewDidLoad
{
NSLog(@"lunched");
UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swiped:)];
swipe.direction = UISwipeGestureRecognizerDirectionDown;
}

最佳答案

- (void)viewDidLoad
{
NSLog(@"lunched");
UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swiped:)];
swipe.direction = UISwipeGestureRecognizerDirectionDown;
//add the following line in your application
[self.view addgesturerecognizer:swipe];
}

我认为您忘记添加要应用滑动手势识别器的 socket

关于iphone - MPMoviePlayerViewController 上的向下滑动手势,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5847437/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com