【发布时间】:2022-11-28 11:01:06
【问题描述】:
在 iPadOS 16.1 中,如果可用空间太小,以下代码将生成一个菜单按钮。虽然无法打开。难道我做错了什么?
NavigationStack {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("Hello, world!")
}
.navigationTitle("Where are the Overflow Menu items?")
.navigationBarTitleDisplayMode(.inline)
.toolbarRole(.editor)
.toolbar {
ToolbarItemGroup(placement: .secondaryAction) {
ImageButton(imageName: "person.fill.questionmark")
ImageButton(imageName: "person.crop.circle.badge.questionmark.fill")
ImageButton(imageName: "questionmark.app.fill")
ImageButton(imageName: "questionmark")
ImageButton(imageName: "questionmark.diamond")
ImageButton(imageName: "person.fill.questionmark")
ImageButton(imageName: "person.crop.circle.badge.questionmark.fill")
ImageButton(imageName: "questionmark.app.fill")
ImageButton(imageName: "questionmark")
ImageButton(imageName: "questionmark.diamond")
}
}
.padding()
}
这就是它的样子。
编辑我现在在单击菜单按钮时发现了这条日志消息:
[UILog] Called -[UIContextMenuInteraction updateVisibleMenuWithBlock:] while no context menu is visible. This won't do anything.
【问题讨论】:
-
你能附上问题的图片吗?如果是,请做!
-
添加了图像并更改了描述。我实际上不确定菜单是否为空,因为如果您设法打开它,那里可能会有项目。