alp*_*nec 3 swiftui swiftui-form
当我使用 SwiftUI 展示工作表时,所有内容都以粗体显示。如果我轻扫一下,粗体就会消失。
例子:
.navigationBarItems(leading:
Button(action:{
self.isSheetPresented.toggle()
}) {
Text("Display")
}
.frame(width: 25, height: 45)
.sheet(isPresented: $isSheetPresented) {
Textfield("Hello", text: $binding)
})
}
Run Code Online (Sandbox Code Playgroud)
除了申请,还有没有简单的解决方法
.fontWeight(.regular) or .font(.body)
Run Code Online (Sandbox Code Playgroud)
一切?
PS:在 MacOS 11.0 Beta (20A5395g) 上运行 Xcode Version 12.2 beta 3 (12B5035g)
尝试将工作表移出 navigationBarItems 并附加到 body 内部的某个视图,例如
// ... other views
.navigationBarItems(leading:
Button(action:{
self.isSheetPresented.toggle()
}) {
Text("Display")
}
.frame(width: 25, height: 45)
)
...
} // end of NavigationView
.sheet(isPresented: $isSheetPresented) { // << here !!
Textfield("Hello", text: $binding)
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
190 次 |
| 最近记录: |