我试着把你在一个空白项目中提到的问题复制到这个故事板上:
a11y recommendations site
为了提供我实现的代码片段,使其能够按需要工作:
class TestButtonTableViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet weak var myTableView: UITableView!
@IBOutlet weak var bottomButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
myTableView.delegate = self as UITableViewDelegate
myTableView.dataSource = self as UITableViewDataSource
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
self.accessibilityElements = [bottomButton, myTableView]
}
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView,
numberOfRowsInSection section: Int) -> Int {
return 2
}
func tableView(_ tableView: UITableView,
cellForRowAt indexPath: IndexPath) -> UITableViewCell {
return zeCell = tableView.dequeueReusableCell(withIdentifier: "myPersoCell",
for: indexPath)
}
}
我做的
right flicks
获取下一个元素并获得以下插图:
画外音导航遵循所需的模式:
-
(导航栏)
.
-
职务
.
-
编辑按钮
.
-
浮动按钮。
-
表格内容。
我没有特别说明
更改了视图控制器中辅助功能元素的顺序,而不会丢失对导航栏的访问权限