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.13k stars 1.33k forks source link

Can't use titlePositionAdjustment #178

Closed yMiecie closed 5 years ago

yMiecie commented 7 years ago

Hello,

I would like to move down titles in RAMAnimatedTabBarItem but titlePositionAdjustment does nothing.

I tried to modify the iconView?.textLabel frame and layer but it also does nothing.

Is there any way to modify the title position ? If not, is it possible to make titlePositionAdjustment work ?

Best Regards, Yann

yehe01 commented 6 years ago

Hi,

I think it's impossible to move down the title label via setting titlePositionAdjustment. This is because the property controls only the layout of the original UITabBar items which has been made transparent. The current visible bar items are laid out using constraints and does not expose such a property to configure the title position.

However, you can configure the y-aix of each bar item by setting yOffSet

furiosFast commented 6 years ago

modify the value of yOffset in this line of code: createConstraints(textLabel, container: container, width: textLabelWidth, yOffset: 18 - item.yOffSet, heightRelation: .greaterThanOrEqual) in RAMAnimatedTabBarController