Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var indicatorViewLeadingConstraint:NSLayoutConstraint! // ---- *
- func setupCustomTabBar(){
- setupCollectioView()
- self.view.addSubview(customTabBar)
- customTabBar.leadingAnchor.constraint(equalTo: self.view.leadingAnchor).isActive = true
- customTabBar.trailingAnchor.constraint(equalTo: self.view.trailingAnchor).isActive = true
- customTabBar.topAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.topAnchor).isActive = true // ---- *
- customTabBar.heightAnchor.constraint(equalToConstant: 60).isActive = true
- customTabBar.addSubview(customTabBarCollectionView)
- customTabBarCollectionView.leadingAnchor.constraint(equalTo: customTabBar.leadingAnchor).isActive = true
- customTabBarCollectionView.trailingAnchor.constraint(equalTo: customTabBar.trailingAnchor).isActive = true
- customTabBarCollectionView.topAnchor.constraint(equalTo: customTabBar.topAnchor).isActive = true
- customTabBarCollectionView.heightAnchor.constraint(equalToConstant: 55).isActive = true
- customTabBar.addSubview(indicatorView)
- indicatorView.widthAnchor.constraint(equalToConstant: self.view.frame.width/4).isActive = true // ---- *
- indicatorView.heightAnchor.constraint(equalToConstant: 5).isActive = true
- indicatorViewLeadingConstraint = indicatorView.leadingAnchor.constraint(equalTo: customTabBar.leadingAnchor)
- indicatorViewLeadingConstraint.isActive = true
- indicatorView.bottomAnchor.constraint(equalTo: customTabBar.bottomAnchor).isActive = true
- }
Add Comment
Please, Sign In to add comment