Skip to content

Commit

Permalink
iPad UI 调整
Browse files Browse the repository at this point in the history
  • Loading branch information
Finb committed Sep 11, 2024
1 parent 7bacae4 commit adf0c17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Controller/BarkSplitViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class BarkSplitViewController: UISplitViewController {
// 设置默认打开页面
let index: Int = Settings[.selectedViewControllerIndex] ?? 0
self.setViewController(sectionViewController.viewControllers[index], for: .secondary)
DispatchQueue.main.async {
self.sectionViewController.tableView.selectRow(at: IndexPath(row: index, section: 0), animated: false, scrollPosition: .none)
}
self.setViewController(compactController, for: .compact)
}
}
Expand All @@ -46,5 +49,6 @@ extension BarkSplitViewController: UISplitViewControllerDelegate {
return
}
self.sectionViewController.tableView.selectRow(at: IndexPath(row: index, section: 0), animated: false, scrollPosition: .none)
self.setViewController(self.sectionViewController.viewControllers[index], for: .secondary)
}
}
5 changes: 5 additions & 0 deletions Controller/SectionViewController-iPad.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,9 @@ class SectionViewController_iPad: BaseViewController<SectionViewModel>, UITableV
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 55
}

func tableView(_ tableView: UITableView, canFocusRowAt indexPath: IndexPath) -> Bool {
// 去掉额外的蓝色 selectionStyle
return false
}
}

0 comments on commit adf0c17

Please sign in to comment.