Skip to content

Commit

Permalink
第4节
Browse files Browse the repository at this point in the history
添加辅助功能修改器
现在,您已经完成了视图的外观和布局,添加可访问性修饰符可以帮助VoiceOver用户浏览控件。
  • Loading branch information
mona-lisa-octo-ue5 committed Jan 6, 2021
1 parent bb1b45f commit 6ba8e10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Binary file not shown.
2 changes: 2 additions & 0 deletions SwiftUIPro/SwiftUIPro/EditView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct EditView: View {
Slider(value: $scrumData.lengthInMinutes,in:5...30,step:1.0){
Text("Length")
}
.accessibilityValue(Text("\(Int(scrumData.lengthInMinutes)) minutes"))
Spacer()
Text("\(Int(scrumData.lengthInMinutes)) minutes")
}
Expand All @@ -40,6 +41,7 @@ struct EditView: View {
}
}){
Image(systemName: "plus.circle.fill")
.accessibilityLabel(Text("Add attendee"))
}
.disabled(newAttendee.isEmpty)
}
Expand Down

0 comments on commit 6ba8e10

Please sign in to comment.