Swift + NSViewController background color (Mac App)

后端 未结 2 1320
长发绾君心
长发绾君心 2021-02-07 00:23

I am trying to change the background color of my View. The View Controller class is NSViewController type.

How this can be done? In iOS UIKit (UIView

2条回答
  •  北荒
    北荒 (楼主)
    2021-02-07 01:12

    Careful: calling setLayer: or setWantsLayer: breaks any WebViews you might have in your application in very creative ways! (Even in different windows...)

    Please see this answer here Best way to change the background color for an NSView.

提交回复
热议问题