Ios 父视图在子视图后面
我在应用程序中使用XLPagerTabStrip库 下面是我如何使用它:Ios 父视图在子视图后面,ios,swift,xcode,xlpagertabstrip,Ios,Swift,Xcode,Xlpagertabstrip,我在应用程序中使用XLPagerTabStrip库 下面是我如何使用它: import UIKit import XLPagerTabStrip class MyAccountViewController: ButtonBarPagerTabStripViewController { override func viewDidLoad() { super.viewDidLoad() self.settings.style.buttonBarBackgroundCo
import UIKit
import XLPagerTabStrip
class MyAccountViewController: ButtonBarPagerTabStripViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.settings.style.buttonBarBackgroundColor = .white
self.settings.style.buttonBarItemBackgroundColor = .white
self.settings.style.selectedBarBackgroundColor = UIColor(red:0.52, green:0.77, blue:0.33, alpha:1.0)
self.settings.style.buttonBarItemFont = .boldSystemFont(ofSize: 13)
self.settings.style.selectedBarHeight = 2.0
self.settings.style.buttonBarMinimumLineSpacing = 10
self.settings.style.buttonBarItemTitleColor = .black
self.settings.style.buttonBarItemsShouldFillAvailableWidth = true
self.settings.style.buttonBarLeftContentInset = 0
self.settings.style.buttonBarRightContentInset = 0
self.settings.style.selectedBarHeight = 4.0
changeCurrentIndexProgressive = { [weak self] (oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void in
guard changeCurrentIndex == true else { return }
oldCell?.label.textColor = UIColor.lightGray
newCell?.label.textColor = .black
}
// navview.addBottomBorderWithColor(color: .lightGray, width: 0.5)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
let child1 = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "jobinfo")
let child2 = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "jobedu")
let child3 = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "jobcv")
return [child1,child2,child3]
}
}
故事板:
但是出于某种原因。。scrollview占据了整个屏幕,所有东西都在它后面,即使我已经设置了它的限制
这就是我得到的:
一切都在孩子的视野后面。。如何解决这个问题?来自他们的指导。“重要提示:应在调用viewDidLoad之前调用设置。”
override func viewDidLoad() {
self.settings.style.selectedBarHeight = 2
self.settings.style.selectedBarBackgroundColor = UIColor.white
super.viewDidLoad()
}