Commit 0866b758 authored by pete谢兆麟's avatar pete谢兆麟

跳转解决

parent f695370a
...@@ -30,6 +30,7 @@ class YHHomePageViewController: YHBaseViewController { ...@@ -30,6 +30,7 @@ class YHHomePageViewController: YHBaseViewController {
collectinoView.dataSource = self collectinoView.dataSource = self
collectinoView.translatesAutoresizingMaskIntoConstraints = false collectinoView.translatesAutoresizingMaskIntoConstraints = false
collectinoView.alwaysBounceVertical = true collectinoView.alwaysBounceVertical = true
collectinoView.isPagingEnabled = false
return collectinoView return collectinoView
}() }()
......
...@@ -122,34 +122,13 @@ private extension YHHkLifeAndIdItemView { ...@@ -122,34 +122,13 @@ private extension YHHkLifeAndIdItemView {
if itemType == .hkID { if itemType == .hkID {
//香港身份 //香港身份
let vc = YHServiceViewController() let vc = YHServiceViewController()
vc.jumpToItemIndex(itemIndex: 0) vc.defaltIndex = 0
UIViewController.current?.navigationController?.pushViewController(vc) UIViewController.current?.navigationController?.pushViewController(vc)
// if let vc = UIApplication.shared.keyWindow?.rootViewController as? YHTabBarViewController {
// vc.selectedIndex = 1
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
// if let vcs = vc.viewControllers,vcs.count > 1 {
// if let nvc = vcs[1] as? YHNavigationController,let vvc = nvc.topViewController as? YHServiceViewController {
// vvc.jumpToItemIndex(itemIndex: 0)
// }
// }
// }
// }
} else if itemType == .hklife { } else if itemType == .hklife {
//香港生活 //香港生活
let vc = YHServiceViewController() let vc = YHServiceViewController()
vc.jumpToItemIndex(itemIndex: 1) vc.defaltIndex = 1
UIViewController.current?.navigationController?.pushViewController(vc) UIViewController.current?.navigationController?.pushViewController(vc)
// if let vc = UIApplication.shared.keyWindow?.rootViewController as? YHTabBarViewController {
// vc.selectedIndex = 1
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
// if let vcs = vc.viewControllers,vcs.count > 1 {
// if let nvc = vcs[1] as? YHNavigationController,let vvc = nvc.topViewController as? YHServiceViewController {
// vvc.jumpToItemIndex(itemIndex: 1)
// }
// }
// }
// }
} else { } else {
printLog("errorr:未处理") printLog("errorr:未处理")
} }
......
...@@ -18,6 +18,7 @@ class YHServiceViewController: YHBaseViewController { ...@@ -18,6 +18,7 @@ class YHServiceViewController: YHBaseViewController {
} }
} }
var defaltIndex: Int = 0
let arrItemTitles = ["香港身份","香港生活"] let arrItemTitles = ["香港身份","香港生活"]
...@@ -108,6 +109,8 @@ class YHServiceViewController: YHBaseViewController { ...@@ -108,6 +109,8 @@ class YHServiceViewController: YHBaseViewController {
make.height.equalTo(k_Height_NavContentBar) make.height.equalTo(k_Height_NavContentBar)
make.width.equalTo(47) make.width.equalTo(47)
} }
segmentedView.defaultSelectedIndex = defaltIndex
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment