All Projects → XYXiaoYuan → XYTabBarAnimation

XYXiaoYuan / XYTabBarAnimation

Licence: MIT license
tabbar点击动画

Programming Languages

objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to XYTabBarAnimation

Swsegmentedcontrol
A Android-like tab bar, drop-in replacement for UISegmentedControl.
Stars: ✭ 115 (+325.93%)
Mutual labels:  tabbar
Iphone Tab In Android
android TabLayout widget at bottom like iPhone UITabBar
Stars: ✭ 181 (+570.37%)
Mutual labels:  tabbar
Sscustomtabbar
Simple Animated tabbar with native control
Stars: ✭ 251 (+829.63%)
Mutual labels:  tabbar
Tabtoolbar
A small library for creating tabbed toolbars
Stars: ✭ 129 (+377.78%)
Mutual labels:  tabbar
Flutter bubble tab indicator
A Flutter library to add bubble tab indicator to TabBar
Stars: ✭ 149 (+451.85%)
Mutual labels:  tabbar
Youtube Ios
youtube iOS app template written in swift 5
Stars: ✭ 2,438 (+8929.63%)
Mutual labels:  tabbar
Sscustombottomnavigation
Animated tabbar with native control
Stars: ✭ 98 (+262.96%)
Mutual labels:  tabbar
react-native-scrollable-tabview
Based on pure JS scripts, without relying on native, no need for react-native link, Title / Header / Tabs / Sticky / Screen components can be flexibly configured, among which Tabs / Sticky can slide When it reaches the top, it will be topped.
Stars: ✭ 136 (+403.7%)
Mutual labels:  tabbar
React Native Head Tab View
Add collapsible headers to your tab-view components.
Stars: ✭ 171 (+533.33%)
Mutual labels:  tabbar
Vbrrollingpit
Simple, beautiful and interactive UITabBar
Stars: ✭ 252 (+833.33%)
Mutual labels:  tabbar
Poliopager
A flexible TabBarController with search tab like SNKRS.
Stars: ✭ 133 (+392.59%)
Mutual labels:  tabbar
Minitabbar
📱 A minimal tab bar alternative
Stars: ✭ 146 (+440.74%)
Mutual labels:  tabbar
Expandedtabbar
ExpandedTabBar is a very creative designed solution for "more" items in UITabBarController. It's greate experience to have more comfortable and intuitive UI.
Stars: ✭ 219 (+711.11%)
Mutual labels:  tabbar
Hhtabbarview
A lightweight customized tabbar view. 📌
Stars: ✭ 125 (+362.96%)
Mutual labels:  tabbar
QWTabBar
自定义TabBar 使用简单
Stars: ✭ 19 (-29.63%)
Mutual labels:  tabbar
Tabbar
🔥空祖家的导航栏工具
Stars: ✭ 100 (+270.37%)
Mutual labels:  tabbar
Rdvtabbarcontroller
Highly customizable tabBar and tabBarController for iOS
Stars: ✭ 2,292 (+8388.89%)
Mutual labels:  tabbar
react-native-tabbar
A tabbar component for React Native
Stars: ✭ 59 (+118.52%)
Mutual labels:  tabbar
RESegmentedControl
Customizable segmented control with style presets...
Stars: ✭ 76 (+181.48%)
Mutual labels:  tabbar
Swiftui Animation
SwiftUI Animation
Stars: ✭ 233 (+762.96%)
Mutual labels:  tabbar

XYTabBarAnimation

tabbar点击动画效果图

实现思路

利用UITabBarControllerUITabBarControllerDelegate,实现代理方法

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController

下面是具体的实现代码

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
{
    NSInteger index = [tabBarController.childViewControllers indexOfObject:viewController];

    UIButton *tabBarBtn = tabBarController.tabBar.subviews[index+1];
    UIImageView *imageView = tabBarBtn.subviews.firstObject;
    // 切换过了,就停止上一个动画
    if (self.currentIndex != index) {
        // 把上一个图片的动画停止
        [self.currentImageView stopAnimating];
        // 把上一个图片的动画图片数组置为空
        self.currentImageView.animationImages = nil;
    } else {
        return NO;
    }

    imageView.animationImages = self.allImages[index];
    imageView.animationRepeatCount = 1;
    imageView.animationDuration = ImageCount * 0.025;

    // 开始动画
    [imageView startAnimating];

    // 记录当前选中的按钮的图片视图
    self.currentImageView = imageView;
    // 记录当前选中的下标
    self.currentIndex = index;

    return YES;
}
  • PS 动画的实现,是利用的帧动画,设计对选中的图片做好帧动画图片给到我们
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].