iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
AlwaysBee
24.8D
0.87D
V2EX  ›  iDev

SwiftUI Picker MenuPickerStyle 遇到奇怪的 Bug 🐛,以及解决方案

  •  
  •   AlwaysBee · Oct 31, 2020 · 4377 views
    This topic created in 2028 days ago, the information mentioned may be changed or developed.

    继续在这里分享一下开发笔记

    吐槽:不得不说,SwiftUI 香是香,但肉眼可见的 Bug 也是挺多的

    今天又抓到一只,并提供了解决方案,希望帮到遇到同样问题的同学

    遇到的错误如下,体现在交互上是菜单选项无法选择

    Called -[UIContextMenuInteraction updateVisibleMenuWithBlock:] while no context menu is visible. This won't do anything.
    

    直达链接

    4 replies    2021-02-07 13:12:52 +08:00
    ufo22940268
        1
    ufo22940268  
       Oct 31, 2020
    盲猜这个 Style 作用的 View 不对,试试作用到 ContainerView 或者 SubView 试试
    AlwaysBee
        2
    AlwaysBee  
    OP
       Oct 31, 2020
    @ufo22940268 不是的,如果这个 Picker 的 selection 是非 ObservableObject 的 state,MenuPickerStyle 就可以正常 works

    原因我还不知道是为什么
    kfchyc
        3
    kfchyc  
       Jan 29, 2021
    贴代码啊大哥
    AlwaysBee
        4
    AlwaysBee  
    OP
       Feb 7, 2021
    @kfchyc 文章里就有
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5347 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 05:54 · PVG 13:54 · LAX 22:54 · JFK 01:54
    ♥ Do have faith in what you're doing.