playing youtube video inside uiwebview. How to handle the “done” button?

后端 未结 4 677
攒了一身酷
攒了一身酷 2021-02-08 10:57

I have a uiwebview that plays a youtube video. How can I handle the done button action? Right now, when I tap the done button it changes back to my app main menu (not the menu t

4条回答
  •  甜味超标
    2021-02-08 11:21

    This thread is very useful and help me to find the problem!

    The answer of lambmj works fine, but I found a better way. In presenting view controller:

      - (void)viewDidAppear:(BOOL)animated {
          [super viewDidAppear:animated];
          if (self.presentedViewController) {
              UIViewController *vc = self.presentedViewController;
              [vc dismissModalViewControllerAnimated:NO];
              [self presentModalViewController:vc
                                      animated:NO];
          }
      }
    

    Hope this helps!

提交回复
热议问题