不知道这是 Docker / Shell / BigSur 更新的问题,但正常的 Docker 构建命令如下:
docker build -f Dockerfile -t MYIMAGE .
Run Code Online (Sandbox Code Playgroud)
最近开始更改默认输出,现在缺少中间层:
我们如何触发该信息的输出,因为官方文档对此没有任何说明。
Docker version 20.10.2
谢谢并致以诚挚的问候
在具有 SwiftUI 生命周期的应用程序中,如何进行下面的转换,其中 AppDelegate 实现为NSApplicationDelegateAdaptor?
let appDelegate = NSApplication.shared.delegate as! AppDelegate
// or
let appDelegate = NSApp.delegate as! AppDelegate
Run Code Online (Sandbox Code Playgroud)
上面抛出以下错误:
无法将“SwiftUI.AppDelegate”(0x1e28fae40)类型的值转换为“MyApp.AppDelegate”(0x102d277c0)。
后台正在扩展中使用 AppDelegate
extension NSStatusBarButton {
public override func mouseDown(with event: NSEvent) {
super.mouseDown(with: event)
let appDelegate = NSApp.delegate as! AppDelegate
// do stuff with appDelegate on MouseDown Event
}
}
Run Code Online (Sandbox Code Playgroud) 在 SwiftUI 2.0 中,我有一个包含一些文本的列表(MacOS 应用程序)
typealias Row = String
@State var row: [Row] = ["1 Row with some content", "2 Some content", "3 Another Row"]
List(row, id: \.self) { content in
Text(content)
.truncationMode(.middle)
.lineLimit(1)
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .topLeading)
.background(Color.blue)
}
Run Code Online (Sandbox Code Playgroud)
这会导致预览中出现以下输出:
如何使行填满所有可用空间?(列表的蓝色框应与文本的蓝色背景相匹配)
在 List 元素中添加 a.listStyle(PlainListStyle())可以减少空间,但还不够:
如何去除内部的蓝色阴影,保持内部透明?
Circle()
.frame(width: 30, height: 30, alignment: .center)
.padding()
.overlay(
RoundedRectangle(cornerRadius: 20)
.strokeBorder(Color.primary, lineWidth: 2)
.shadow(color: Color.blue.opacity(1), radius: 3, x: 3, y: 3)
)
Run Code Online (Sandbox Code Playgroud)