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

iOS 11 UIWebView下拉菜单完全打破了iPad – UIPopoverController,第1张

概述当使用 HTML select元素时,UIWebView在iPad上将本机UIPopoverController作为下拉列表呈现(iPhone使用UIPickerView,工作正常). 在iOS11上,这似乎完全破碎了: >单击外部下拉列表以在不选择选项的情况下关闭,导致d出窗口关闭并立即重新显示,偶尔为空 >当页面上有多个下拉列表时,下拉列表中的新列表包含上一个列表中的元素 >选择第二个下拉菜单 当使用 HTML select元素时,UIWebVIEw在iPad上将本机UIPopoverController作为下拉列表呈现(iPhone使用UIPickerVIEw,工作正常).

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

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

2017-09-23 09:43:13.190728+0100 Web[1779:86622] * Terminating app
due to uncaught exception ‘NSInternalinconsistencyException’,reason:
‘UItableVIEw dataSource is not set’
* First throw call stack: ( 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:inSection: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:animated:usingPresentationValues:]
+ 146 12 UIKit 0x000000010da51a11 -[UItableVIEw scrollToRowAtIndexPath:atScrollposition:animated:] + 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 0x000000010d945600
_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 main + 111 27 libdyld.dylib
0x0000000110df1d81 start + 1 28 ???
0x0000000000000001 0x0 + 1`

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

https://github.com/AshRobinson/BrokenUIWebView

http://gph.is/2xmHFWs

有没有人有这样的问题的解决方法?在此阶段,我们无法迁移到WKWebvIEw.

有没有办法迫使iPad暂时使用UIPickerVIEw进行下拉?

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

ios 11 Beta 5 select drop-down list issue

解决方法 我们遇到了同样的错误. Apple’s documentation说iOS 8应用程序应该使用WKWebVIEw.一旦我们切换到WKWebVIEw,我们就不再看到这个问题了. 总结

以上是内存溢出为你收集整理的iOS 11 UIWebView下拉菜单完全打破了iPad – UIPopoverController全部内容,希望文章能够帮你解决iOS 11 UIWebView下拉菜单完全打破了iPad – UIPopoverController所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1081979.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存