iPad MPMoviePlayerController - Disable Fullscreen

后端 未结 16 2125
一向
一向 2020-12-06 01:38

Is there a way to disable the fullscreen button of the MPMoviePlayerController ?

16条回答
  •  一个人的身影
    2020-12-06 02:06

    If the only thing you want to do is disable pinch to go full screen (i.e. keep interaction enabled and whatever control style you want), you can use this:

    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    
        NSSet *set = [event allTouches];
        NSArray *arr = [set allObjects];
        for (int i = 0; i < arr.count; i++) {
            UITouch *touch = (UITouch *) [arr objectAtIndex:i];
    
            NSArray *recognisers = touch.gestureRecognizers;
            for (UIGestureRecognizer *recogniser in recognisers) {
                if (recogniser.enabled && [recogniser isMemberOfClass:[UIPinchGestureRecognizer class]]) {
                    recogniser.enabled = NO;
                }
            }
        }
    }
    

提交回复
热议问题