文章来源:淘论文网   发布者: 毕业设计   浏览量: 31



还可以点击去查询以下关键词:
[数字]    [定制]    [换动]    [Fade数字切定制换动效]   

项目介绍:

欢迎同样喜爱动效的你加入

iOS动效特攻队–>QQ群:547897182

iOS动效特攻队–>熊熊:648070256

CRAnimation开源项目:https://github.com/CRAnimation/CRAnimation

gitHub:CRNumberFadedAnimation断断续续3周的时间,把这个动效还原出来了。原型是这样的。

最终的实现效果是这样的

当然了,这个动效里面的部分控件还是可以使用的。大家英文都辣么好,除非特别难理解的,一般的我就不写注释了。数字切换控件 CRNumberFaded

CRNumberFaded 控件实际上只有三个Label 在一直复用。所以可以不用担心内存的问题哦。

//基本用法 CRNumberFaded *_numberFadedView = [[CRNumberFaded alloc] initWithFrame:CGRectMake(0, 0, 200, 200)]; _numberFadedView.font = [UIFont fontWithName:@'Helvetica-Bold' size:150]; _numberFadedView.textColor = [UIColor whiteColor]; _numberFadedView.strings = strings; _numberFadedView.delegate = self; _numberFadedView.backgroundColor = [UIColor clearColor]; [_sliderIndicator addSubview:_numberFadedView]; //可使用参数和方法 @property (weak, nonatomic) id <CRNumberFadedDelegate> delegate; @property (strong, nonatomic) NSArray *strings; @property (strong, nonatomic) UIFont *font; @property (strong, nonatomic) UIColor *textColor; @property (assign, nonatomic) BOOL allowCircle; //是否允许无限滚动 - (void)showNextView; - (void)showLastView; - (void)showToIndex:(int)toIndex; //支持的代理方法 @protocol CRNumberFadedDelegate <NSObject> - (void)willShowLastOneFadeAnimationWithString:(NSString *)string index:(int)index; - (void)willStartFirstAnimationWithString:(NSString *)string index:(int)index; - (void)fadingAnimationWithString:(NSString *)string index:(int)index; @end滑杆控件 CRSlider

CRSlider 继承自UIControl ,支持UIControlEventValueChanged 监听事件。
原生的UISlider可自定义的属性满足不了这个动效的需求,只能自己重新写了。

//基本用法 CRSlider *_slider = [[CRSlider alloc] initWithFrame:CGRectMake(0, 0, WIDTH, 40)]; _slider.delegate = self; _slider.minimumValue = 0; _slider.maximumValue = _maxNum; _slider.poleImageVOffX = _poleImageVOffX; [_slider addTarget:self action:@selector(testSliderChanged:) forControlEvents:UIControlEventValueChanged]; [self.view addSubview:_slider]; //可使用参数和方法 @property(nonatomic) float value; @property(nonatomic) float minimumValue; @property(nonatomic) float maximumValue; @property(nonatomic) float poleImageVOffX; @property (strong, nonatomic) UIImageView *poleImageV; @property (strong, nonatomic) UIImageView *thumbImageV; //支持的代理方法 @protocol CRSliderDelegate <NSObject> - (void)thumbImageVDidSlided:(CRSlider *)slider; @end滑杆指示器控件 CRSliderIndicator

指示器里面的这个圆槽是折腾了一段时间才出来的。主要考虑到适配的问题,论文,想想还是用比例来做的,通过Sketch临摹出曲线,然后把贝塞尔曲线的几个控制点挑出来,开题报告,通过比例来做适配。图示如下,只点出来了左半边的几个点,右半边的同理。

//基本用法 CRSliderIndicator *_sliderIndicator = [[CRSliderIndicator alloc] initWithFrame:CGRectMake(0, _customNaviBarView.maxY, WIDTH, sliderIndicatorHeight) withStrings:strings]; _sliderIndicator.chipOffX = _poleImageVOffX; [self.view addSubview:_sliderIndicator]; //可使用参数和方法 @property (assign, nonatomic) CGFloat circleCenterX; //Slider按钮的CenterX @property (assign, nonatomic) CGFloat r; //Slider按钮的半径 @property (assign, nonatomic) CGFloat toCircleCenterYDistance; //Slider按钮的垂直距离 @property (strong, nonatomic) NSArray *gradientColors; //背景渐变色数组 @property (assign, nonatomic) CGFloat chipOffX; - (instancetype)initWithFrame:(CGRect)frame withStrings:(NSArray *)strings;

撸动效揪心的还是细节的不断调试,因为想尽可能的还原出来还是需要慢慢打磨的。不过希望大家能喜欢,也能真正的用在项目中。
如果各位在使用过程中遇到问题或者bug,欢迎在github上提出issue。


这里还有:


还可以点击去查询:
[数字]    [定制]    [换动]    [Fade数字切定制换动效]   

请扫码加微信 微信号:sj52abcd


下载地址: http://www.taolw.com/down/7269.docx
  • 上一篇:天气动画
  • 下一篇:Swift开发的定制天气APP