Discussion 議論
Use this behavior when you want a view represented by a single accessibility element. The new accessibility element has no initial properties. So you will need to use other accessibility modifiers, such as accessibility
, to begin making it accessible.
var body: some View {
VStack {
Button("Previous Page", action: goBack)
Text("\(pageNumber)")
Button("Next Page", action: goForward)
}
.accessibilityElement(children: .ignore)
.accessibilityValue("Page \(pageNumber) of \(pages.count)")
.accessibilityAdjustableAction { action in
if action == .increment {
goForward()
} else {
goBack()
}
}
}
Before using the ignore
behavior, consider using the combine
behavior.
Note 注意
A new accessibility element is always created.