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.83D
V2EX  ›  iDev

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

  •  
  •   AlwaysBee · Oct 31, 2020 · 4865 views
    This topic created in 2203 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
    ufo22940268
    Oct 31, 2020
    1
    盲猜这个 Style 作用的 View 不对,试试作用到 ContainerView 或者 SubView 试试
    AlwaysBee
    AlwaysBee
    OP
    Oct 31, 2020
    2
    @ufo22940268 不是的,如果这个 Picker 的 selection 是非 ObservableObject 的 state,MenuPickerStyle 就可以正常 works

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