V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
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
V2EX  ›  iDev

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

  •  
  •   AlwaysBee · 2020-10-31 17:12:44 +08:00 · 3378 次点击
    这是一个创建于 1266 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

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

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

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

    直达链接

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

    原因我还不知道是为什么
    kfchyc
        3
    kfchyc  
       2021-01-29 14:34:41 +08:00
    贴代码啊大哥
    AlwaysBee
        4
    AlwaysBee  
    OP
       2021-02-07 13:12:52 +08:00
    @kfchyc 文章里就有
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2731 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 05:39 · PVG 13:39 · LAX 22:39 · JFK 01:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.