I need Customized Tab Bar,
however container PageViewController’s SafeArea is Not StackView.bottomAnchor.
PageViewController’s SafeArea is view.safeLayoutGuide.topAnchor
I need TabManViewContorller’s topBarContainer.addArrangeSubviews, however It is inner so I am unable to.
How Can I do that like second Image ?
class ButtonBarExampleViewController: TabmanViewController, PageboyViewControllerDataSource, TMBarDataSource {
// MARK: Properties
non-public let stackView: UIStackView = {
let stackView = UIStackView()
stackView.axis = .vertical
stackView.backgroundColor = .crimson
stackView.translatesAutoresizingMaskIntoConstraints = false
return stackView
}()
non-public let imageView: UIImageView = {
let imageView = UIImageView()
imageView.backgroundColor = .inexperienced
return imageView
}()
non-public let tempView = UIView()
/// View controllers that can be displayed in web page view controller.
non-public lazy var viewControllers: [UIViewController] = [
ChildViewController(page: 1),
ChildViewController(page: 2),
ChildViewController(page: 3),
ChildViewController(page: 4),
ChildViewController(page: 5)
]
// MARK: Lifecycle
override func viewDidLoad() {
tremendous.viewDidLoad()
// Set PageboyViewControllerDataSource dataSource to configure web page view controller.
dataSource = self
// Create a bar
let bar = TMBarView.ButtonBar()
...
// Add bar to the view - as a .systemBar() so as to add UIKit fashion system background views.
// addBar(bar.systemBar(), dataSource: self, at: .prime)
addBar(bar, dataSource: self, at: .customized(view: tempView, structure: nil))
view.addSubview(stackView)
NSLayoutConstraint.activate([
stackView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
stackView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
stackView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
imageView.heightAnchor.constraint(equalToConstant: 60)
])
stackView.addArrangedSubview(imageView)
stackView.addArrangedSubview(tempView)
}
}