I need to layout tab bar custom icon items, but I don't know how I can do this properly, here are the visual issues I'm having with icon and text:
I want to indent 20 pх for image from the top edge of Tab Bar and 20 px for title text from image. Code below...
My code in Xcode 11.5
let navigationVC = UINavigationController(rootViewController: rootVC)
navigationVC.tabBarItem.image = UIImage(named: TBimageName)
navigationVC.tabBarItem.title = TBTitle
navigationVC.tabBarItem.imageInsets = UIEdgeInsets(top: 0, left: 0, bottom: -16, right: 0)
rootVC.navigationItem.title = TBTitle
I can configure the image display through the "imageInsets" but in this case, my title stays in its place and overlaps the image.
I don't know how I can fix this. Maybe I can used some method to layout for tabBarItem.title?