Ramotion / animated-tab-bar

:octocat: RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion
https://www.ramotion.com/animated-tab-bar-ios-app-development-ui-library/
MIT License
11.12k stars 1.33k forks source link

How to adjust the gap between icon and title in item, thank you #273

Closed BeingCode closed 4 years ago

BeingCode commented 4 years ago
A527C928-0105-48D1-BDD9-D0075460D191
igork-ramotion commented 4 years ago

@BeingCode hey!) You can take a look at UITabBarItem variable titlePositionAdjustment. But it will adjust both icon and title position (Apple do the same)

If you want to change space you can use this constants. Hope it will help 🤞🏻

public static let defaultTitleVerticalOffset: CGFloat = 10
public static let defaultIconVerticalOffset: CGFloat = -5
BeingCode commented 4 years ago

@igork-ramotion The middle picture is large. I want to move the raised display upward without blocking the text below

igork-ramotion commented 4 years ago

@BeingCode Currently library doesn't support that functionality, but if you want you can add it by yourself
The starting point may be the function func layoutContainers() there all layout items calculation happen

BeingCode commented 4 years ago

@igork-ramotion I adjusted the position of the icon, but the raised part of the item in the middle couldn't respond, thank you

BeingCode commented 4 years ago

@igork-ramotion 13051574155848_ pic

igork-ramotion commented 4 years ago

@BeingCode you need to handle interaction on that item separately (maybe by using custom button or by gesture recogniser). Library doesn't support this functionality