在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):Ramotion/animated-tab-bar开源软件地址(OpenSource Url):https://github.com/Ramotion/animated-tab-bar开源编程语言(OpenSource Language):Swift 98.3%开源软件介绍(OpenSource Introduction):ANIMATED TAB BARSwift UI module library for adding animation to iOS tabbar items and icons.We specialize in the designing and coding of custom UI for Mobile Apps and Websites.Stay tuned for the latest updates:Requirements
InstallationJust add the RAMAnimatedTabBarController folder to your project. or use CocoaPods with Podfile: pod 'RAMAnimatedTabBarController' or Carthage users can simply add to their
Usage
Included Animations
Creating Custom Animations
class NewAnimation : RAMItemAnimation
// method call when Tab Bar Item is selected
override func playAnimation(icon: UIImageView, textLabel: UILabel) {
// add animation
} // method call when Tab Bar Item is deselected
override func deselectAnimation(icon: UIImageView, textLabel: UILabel, defaultTextColor: UIColor, defaultIconColor: UIColor) {
// add animation
} // method call when TabBarController did load
override func selectedState(icon: UIImageView, textLabel: UILabel) {
// set selected state
}
import RAMAnimatedTabBarController
class RAMBounceAnimation : RAMItemAnimation {
override func playAnimation(_ icon: UIImageView, textLabel: UILabel) {
playBounceAnimation(icon)
textLabel.textColor = textSelectedColor
}
override func deselectAnimation(_ icon: UIImageView, textLabel: UILabel, defaultTextColor: UIColor, defaultIconColor: UIColor) {
textLabel.textColor = defaultTextColor
}
override func selectedState(_ icon: UIImageView, textLabel: UILabel) {
textLabel.textColor = textSelectedColor
}
func playBounceAnimation(_ icon : UIImageView) {
let bounceAnimation = CAKeyframeAnimation(keyPath: "transform.scale")
bounceAnimation.values = [1.0 ,1.4, 0.9, 1.15, 0.95, 1.02, 1.0]
bounceAnimation.duration = TimeInterval(duration)
bounceAnimation.calculationMode = kCAAnimationCubic
icon.layer.add(bounceAnimation, forKey: "bounceAnimation")
}
} |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论