Guest User

Untitled

a guest
Apr 25th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. var indicatorViewLeadingConstraint:NSLayoutConstraint! // ---- *
  2. func setupCustomTabBar(){
  3. setupCollectioView()
  4. self.view.addSubview(customTabBar)
  5. customTabBar.leadingAnchor.constraint(equalTo: self.view.leadingAnchor).isActive = true
  6. customTabBar.trailingAnchor.constraint(equalTo: self.view.trailingAnchor).isActive = true
  7. customTabBar.topAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.topAnchor).isActive = true // ---- *
  8. customTabBar.heightAnchor.constraint(equalToConstant: 60).isActive = true
  9.  
  10. customTabBar.addSubview(customTabBarCollectionView)
  11. customTabBarCollectionView.leadingAnchor.constraint(equalTo: customTabBar.leadingAnchor).isActive = true
  12. customTabBarCollectionView.trailingAnchor.constraint(equalTo: customTabBar.trailingAnchor).isActive = true
  13. customTabBarCollectionView.topAnchor.constraint(equalTo: customTabBar.topAnchor).isActive = true
  14. customTabBarCollectionView.heightAnchor.constraint(equalToConstant: 55).isActive = true
  15.  
  16. customTabBar.addSubview(indicatorView)
  17. indicatorView.widthAnchor.constraint(equalToConstant: self.view.frame.width/4).isActive = true // ---- *
  18. indicatorView.heightAnchor.constraint(equalToConstant: 5).isActive = true
  19. indicatorViewLeadingConstraint = indicatorView.leadingAnchor.constraint(equalTo: customTabBar.leadingAnchor)
  20. indicatorViewLeadingConstraint.isActive = true
  21. indicatorView.bottomAnchor.constraint(equalTo: customTabBar.bottomAnchor).isActive = true
  22. }
Add Comment
Please, Sign In to add comment