iOS 11 UIWebView下拉菜单完全打破了iPad - UIPopoverController

use*_*333 5 uiwebview ipad uipopovercontroller dropdown ios11

当使用HTML select元素时,在iPad上UIWebView呈现原生的UIPopoverController下拉列表(iPhone使用UIPickerView它可以正常工作).

在iOS11上,这似乎完全破碎了:

  • 单击外部下拉列表以在不选择选项的情况下关闭会导致弹出窗口关闭并立即重新显示,偶尔会为空
  • 当页面上有多个下拉列表时,下拉列表中的新列表包含上一个列表中的元素
  • 选择第二个下拉菜单时,首先重新打开
  • 偶尔下拉出现在左上角(可能是丢失了它的源视图)
  • 以上步骤偶尔会导致以下崩溃:

2017-09-23 09:43:13.190728 + 0100 Web [1779:86622] *由于未捕获的异常'NSInternalInconsistencyException'终止应用程序,原因:'UITableView dataSource未设置'*第一次抛出调用堆栈:(0 CoreFoundation 0x000000010d4a01cb exceptionPreprocess + 171 1 libobjc.A.dylib
0x000000010c8bbf41 objc_exception_throw + 48 2 CoreFoundation
0x000000010d4a5362 + [NSException raise:format:arguments:] + 98 3
Foundation 0x000000010c360089 - [NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193 4
UIKit 0x000000010da742f5 - [的UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1756 5的UIKit 0x000000010da7451a - [UITableView的_createPreparedCellForRowAtIndexPath:willDisplay:] + 81 6的UIKit 0x000000010da82137 - [UITableView的_heightForRowAtIndexPath:] + 208 7
的UIKit 0x000000010dd2b939 - [UISectionRowData heightForRow:切入口:canGuess:] + 259 8 UIKit 0x000000010dd31c1a - [UITableViewRowData heightForRow:inSection:canGuess:adjustForReorderedRow:] + 277 9
UIKit的0x000000010dd36230 - [UITableViewRowData ensureHeightsFaultedInForScrollToIndexPath:withScrollPosition:boundsHeight:] + 964 10的UIKit 0x000000010da51110 - [UITableView的_contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:usingPresentationValues:] + 2783 11的UIKit 0x000000010da51b8f - [UITableView的_scrollToRowAtIndexPath:atScrollPosition:动画:usingPresentationValues:] + 146 12的UIKit 0x000000010da51a11 - [UITableView的scrollToRowAtIndexPath:atScrollPosition:动画:] + 123 13的UIKit 0x000000010de72d11 - [UIWebSelectTableViewController viewWillAppear中:] + 247 14的UIKit 0x000000010dabe9b0 - [UIViewController中_setViewAppearState:isAnimating:] + 444 15的UIKit 0x000000010dabf245 - [UIViewController中__viewWillAppear:] + 147 16的UIKit 0x000000010da8b881 __56 - [UIPresentationController runTransitionForCurrentState] _block_invoke + 1088 17 UIKit
0x000000010d926c61 _runAfterCACommitDeferredBlocks + 318 18 UIKit
0x000000010d91530d _cleanUpAfterCAFlushAndRunDeferredBlocks + 280 19 UIKit 0x000000010 d945600 _afterCACommitHandler + 137 20的CoreFoundation 0x000000010d442db7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION
+ 23 21的CoreFoundation 0x000000010d442d0e __CFRunLoopDoObservers + 430 22的CoreFoundation 0x000000010d427324 __CFRunLoopRun + 1572 23的CoreFoundation
0x000000010d426a89 CFRunLoopRunSpecific + 409个24 GraphicsServices
0x00000001124c89c6 GSEventRunModal + 62 25的UIKit
0x000000010d91ad30 UIApplicationMain + 159 26的Web
0x000000010bfb014f主+ 111 27 libdyld.dylib
0x0000000110df1d81开始+ 1 28 ???
0x0000000000000001 0x0 + 1`

我创建了一个示例应用程序,其中包含一行代码,用于演示此问题:

https://github.com/AshRobinson/BrokenUIWebView

http://gph.is/2xmHFWs

有没有人有这样的问题的解决方法?WKWebview在此阶段,迁移到我们不是一个选择.

有没有办法迫使iPad UIPickerView临时使用iPhone下拉?

我已经调查了其他堆栈溢出帖子中没有运气的建议,例如:

ios 11 Beta 5选择下拉列表问题

小智 1

我们遇到了同样的错误。Apple 的文档称任何 iOS 8+ 的应用程序都应该使用 WKWebView。一旦我们切换到 WKWebView,我们就不再看到这个问题。