ios8 iPad uiwebview crashes while displaying popover when user taps drop down list HTML select tag

前端 未结 5 1673
生来不讨喜
生来不讨喜 2020-11-30 21:00

On ios8 and iPad if a uiwebview is displaying a HTML page containing a drop down list

eg this page http://www.w3schools.com/tags/tryit.asp?filename=tryh

5条回答
  •  醉酒成梦
    2020-11-30 21:28

    I worked around it in the following way after noticing that sourceView is set in the cases where it crashes:

    -(void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion {
    
      UIPopoverPresentationController* pres = viewControllerToPresent.popoverPresentationController;
    
      if(pres.sourceView) {
        //log the fact you are ignoring the call
      }
      else {
        [super presentViewController:viewControllerToPresent animated:flag completion:completion];
      }
    }
    

提交回复
热议问题