How to put SwiftUI button into NSToolbar?

后端 未结 4 1537
失恋的感觉
失恋的感觉 2020-12-18 05:14

This is how SwiftUI can be inserted into NSToolbar using an accessory view controller:

import SwiftUI
import PlaygroundSupport

var hostingView          


        
4条回答
  •  暖寄归人
    2020-12-18 06:10

    It seems that applying PlainButtonStyle to the button helps. Default style is doing some weird magic that is breaking the layout in NSToolbar.

提交回复
热议问题