Skip to content

mohammed-abuamra/custom-tabbarcontroller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

custom-tabbarcontroller

How to set top left and right corner radius with desired drop shadow in UITabBar ?

alt text


Steps

  1. Add a coustmeTabBarView.
  • Add the cornerRadius to coustmeTabBarView.
  • Add the shadow to coustmeTabBarView.
  1. In viewDidLayoutSubviews make the coustmeTabBarView frame equal to tabBar frame.
  • In viewDidAppear Adjust the safe area to the height of the bottom views.
  • In viewDidAppear Adjust the safe area insets of the embedded child view controller .
  1. Add private func with name addcoustmeTabBarView .
  • In addcoustmeTabBarView make the coustmeTabBarView frame equal to tabBar frame.
  • In addcoustmeTabBarView addSubview coustmeTabBarView to view.
  • In addcoustmeTabBarView bringSubviewToFront tabBar to view.
  1. Add func hideTabBarBorder (optional).
  • In hideTabBarBorder make the tabBar background Image & tabBar shadowImage to empty image .
  • In hideTabBarBorder make tabBar clipsToBounds = true.
  1. Add func addcoustmeTabBarView & hideTabBarBorder to viewDidLoad