iOS自定义控件之倒计时器

【IOS 开发学习总结-OC-48】★★ios开发之UI控件——UIDatePicker与 UIPickerView 【IOS 开发学习总结-OC-48】★★ios开发之UI控件——UIDatePicker与 UIPickerViewUIDatePicker控件——日期选择器用来选择日期与时间,也可以作为倒计时控件。UIDatePicker继承了 UIControl——可作为活动控件使用,与用户进行交互,既可以在 interface builder,也可以在代码中绑定事件处理方法。 属性面板简要说明: 1. m 阅读详情

本文将介绍一个拥有圆环形状的倒计时器,涉及到的主要内容有路径绘制、动画、多线程和一些时间单位的相互转换,虽然这么多的内容看起来会很复杂,但跟着小编一步一步来实现,你就会发现原来可以这么简单。所以这里不再对这个控件作过多的陈述了,如果这样做的话是会在开头就出现一段不小的篇幅,我想这样你们是不会耐心看下去的(好吧,我承认是我太懒,没想到小学就学会的造句在今天看来是如此的艰难),不瞎扯了,直接上图吧。

----------------------------------------------------------------------------------------还是分割线------------------------------------------------------------------------------

完成效果图


----------------------------------------------------------------------------------------还是分割线------------------------------------------------------------------------------

1. 创建我们的GYCCircularTimer类

  • 在Xcode里新建一个类,取名GYCCircularTimer,继承UIView
  • 打开GYCCircularTimer.h文件,先从添加属性成员开始,想想一个倒计时器有哪些属性?看图!得有个用于显示它名字的Label吧、还得有个显示剩余时间的Label,圆环这样形状的用半径就可以表示出它的大小了吧、前面的环形圈和后面的环形圈,想想都头大......上代码吧:
[objc]  view plain  copy
  1. @property (assign, nonatomic) CGFloat radius;  
  2.   
  3. @property (strong, nonatomic) CAShapeLayer *foregroundLayer;  
  4. @property (assign, nonatomic) CGFloat foregroundPathWidth;  
  5. @property (strong, nonatomic) UIColor *foregroundPathColor;  
  6.   
  7. @property (strong, nonatomic) CAShapeLayer *backgroundLayer;  
  8. @property (assign, nonatomic) CGFloat backgroundPathWidth;  
  9. @property (strong, nonatomic) UIColor *backgroundPathColor;  
  10.   
  11. @property (strong, nonatomic) UIView *contentView;  
  12. @property (strong, nonatomic) UILabel *titleLabel;  
  13. @property (strong, nonatomic) UILabel *timeLabel;  
  14.   
  15. @property (assign, nonatomic) id <CircularTimerDelegate> delegata;  

我没说让读者就照这样写,怎么声明一个类的属性成员我想还是挺有讲究的吧,所以你大可按你自己的方式来定义类成员,但你够懒的话就直接Copy吧,这里另外定义了一个delegate,后面会用到,这里先添加以下代码到文件顶部位置:
[objc]  view plain  copy
  1. @protocol CircularTimerDelegate <NSObject>  
  2.   
  3. - (void)finishedCountDown;  
  4.   
  5. @end  

那么接下来就是公共接口的方法了(说明都写在注释里了,对就是给你看绿色字体来着):
[objc]  view plain  copy
  1. /** 
  2.  *  初始化CircularTimer 
  3.  * 
  4.  *  @param center      圆心位置 
  5.  *  @param r           半径 
  6.  *  @param width       线宽 
  7.  *  @param color       颜色 
  8.  *  @param isClockWise 是否顺时针 
  9.  *  @param t           标题 
  10.  *  @param h           小时 
  11.  *  @param m           分钟 
  12.  *  @param s           秒 
  13.  * 
  14.  *  @return CircularTimer实例 
  15.  */  
  16. - (instancetype)initWithCenter:(CGPoint)center  
  17.                         Radius:(CGFloat)r  
  18.                      PathWidth:(CGFloat )width  
  19.                      PathColor:(UIColor *)color  
  20.                      Clockwise:(BOOL)isClockWise  
  21.                          Title:(NSString *)t  
  22.                           Hour:(NSUInteger)h  
  23.                         Minute:(NSUInteger)m  
  24.                         Second:(NSUInteger)s;  
  25. /** 
  26.  *  开始记时 
  27.  */  
  28. - (void)startCount;  
  29.   
  30. /** 
  31.  *  暂停 
  32.  */  
  33. - (void)pauseCount;  
  34.   
  35. /** 
  36.  *  继续 
  37.  */  
  38. - (void)resumeCount;  
  39.   
  40. /** 
  41.  *  停止 
  42.  */  
  43. - (void)stopCount;  
  44.   
  45. /** 
  46.  *  设置前景进度条 
  47.  * 
  48.  *  @param width 宽度 
  49.  *  @param color 颜色 
  50.  */  
  51. - (void)setForegroundProcessWidth:(CGFloat)width Color:(UIColor *)color;  
  52.   
  53. /** 
  54.  *  设置背景进度条 
  55.  * 
  56.  *  @param width 宽度 
  57.  *  @param color 颜色 
  58.  */  
  59. - (void)setBackgroundProcessWidth:(CGFloat)width Color:(UIColor *)color;  
  60.   
  61. /** 
  62.  *  设置标题 
  63.  * 
  64.  *  @param size  字体大小 
  65.  *  @param color 字体颜色 
  66.  */  
  67. - (void)setTitleFontSize:(CGFloat)size Color:(UIColor *)color;  
  68.   
  69. /** 
  70.  *  设置时间 
  71.  * 
  72.  *  @param size  字体大小 
  73.  *  @param color 字体颜色 
  74.  */  
  75. - (void)setTimeFontSize:(CGFloat)size Color:(UIColor *)color;  

  • 让我们看看.m文件里需要做的准备工作有哪些(当然是还是声明我们需要的变量啦):
[objc]  view plain  copy
  1. @interface GYCCircularTimer () {  
  2.     //一个环形路径变量  
  3.     UIBezierPath *path;  
  4.     //最初设置的总时长  
  5.     NSInteger duration;  
  6.     //剩余时间  
  7.     NSInteger remain;  
  8.       
  9.     //缓存倒计时器的标题文本内容  
  10.     NSString *title;  
  11.     //小时  
  12.     NSUInteger hour;  
  13.     //分钟  
  14.     NSUInteger minute;  
  15.     //秒  
  16.     NSUInteger second;  
  17.       
  18.     //用于倒计时的NSTimer对象变量  
  19.     NSTimer *countDownTimer;  
  20. }  
  21.   
  22. @end  

GYCCircularTimer类的准备工作到此结束,接下来就是具体的实现。

2. 那么开始实现吧

  • 这次我们首先来完成倒计时器里面控件的布局和基本属性设置,先来看看initCircularTimer方法吧:
[objc]  view plain  copy
  1. - (void)initCircularTimer {  
  2.     //设置背景环形圈  
  3.     self.backgroundLayer = [CAShapeLayer layer];  
  4.     [self.backgroundLayer setPath:[path CGPath]];  
  5.     [self.backgroundLayer setFillColor:[[UIColor clearColor] CGColor]];  
  6.     [self.backgroundLayer setStrokeColor:[self.backgroundPathColor CGColor]];  
  7.     [self.backgroundLayer setLineWidth:self.backgroundPathWidth];  
  8.     [self.layer addSublayer:self.backgroundLayer];  
  9.       
  10.     //设置前景环形圈  
  11.     self.foregroundLayer = [CAShapeLayer layer];  
  12.     [self.foregroundLayer setPath:[path CGPath]];  
  13.     [self.foregroundLayer setFillColor:[[UIColor clearColor] CGColor]];  
  14.     [self.foregroundLayer setStrokeColor:[self.foregroundPathColor CGColor]];  
  15.     [self.foregroundLayer setLineWidth:self.foregroundPathWidth];  
  16.     [self.foregroundLayer setStrokeEnd:0];  
  17.     [self.layer addSublayer:self.foregroundLayer];  
  18.       
  19.     //内容视图包括标题的显示和时间的倒数  
  20.     self.contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)/3)];  
  21.     [self.contentView setCenter:CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds))];  
  22.     [self addSubview:self.contentView];  
  23.       
  24.     //设置标题的Label  
  25.     self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.contentView.bounds), CGRectGetHeight(self.contentView.bounds)/2)];  
  26.     [self.titleLabel setText:title];  
  27.     [self.titleLabel setTextColor:[UIColor darkGrayColor]];  
  28.     [self.titleLabel setTextAlignment:NSTextAlignmentCenter];  
  29.     [self.contentView addSubview:self.titleLabel];  
  30.       
  31.     //设置倒计时的Label  
  32.     self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(self.titleLabel.bounds), CGRectGetWidth(self.titleLabel.bounds), CGRectGetHeight(self.titleLabel.bounds))];  
  33.     //设置时间格式为00:00:00  
  34.     [self.timeLabel setText:[NSString stringWithFormat:@"%02d:%02d:%02d", hour, minute, second]];  
  35.     [self.timeLabel setTextColor:[UIColor darkGrayColor]];  
  36.     [self.timeLabel setTextAlignment:NSTextAlignmentCenter];  
  37.     [self.contentView addSubview:self.timeLabel];  
  38. }  

  • 然后实现类的初始化方法initWithCenter:
[objc]  view plain  copy
  1. - (instancetype)initWithCenter:(CGPoint)center Radius:(CGFloat)r PathWidth:(CGFloat)width PathColor:(UIColor *)color Clockwise:(BOOL)isClockWise Title:(NSString *)t Hour:(NSUInteger)h Minute:(NSUInteger)m Second:(NSUInteger)s {  
  2.     self = [super initWithFrame:CGRectMake(center.x-r, center.y-r, r*2, r*2)];  
  3.     if (self) {  
  4.         //设置path的路径为一个环形,这里从0°开始是3点钟水平方向,增大角度是顺时针方向,那么要实现秒表从12点钟开始旋转的轨迹,就得把开始角度设置为-90°,结束角度设置270°,是否顺时针转动由参数isClockWise决定。  
  5.         path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)) radius:r startAngle:-0.5*M_PI endAngle:1.5*M_PI clockwise:isClockWise];  
  6.         //算出总的时长  
  7.         duration = h*3600 + m*60 + s;  
  8.         //刚开始的剩余时间就等于总时长  
  9.         remain = duration;  
  10.           
  11.         self.foregroundPathColor = color;  
  12.         self.foregroundPathWidth = width;  
  13.         self.backgroundPathColor = [UIColor darkGrayColor];  
  14.         self.backgroundPathWidth = width;  
  15.           
  16.         title = t;  
  17.         hour = h;  
  18.         minute = m;  
  19.         second = s;  
  20.           
  21.         [self initCircularTimer];  
  22.     }  
  23.       
  24.     return self;  
  25. }  

  • 顺便把这两个改变环形进度条宽度和颜色的也给做了:
[objc]  view plain  copy
  1. - (void)setForegroundProcessWidth:(CGFloat)width Color:(UIColor *)color {  
  2.     [self.foregroundLayer setLineWidth:width];  
  3.     [self.foregroundLayer setStrokeColor:[color CGColor]];  
  4. }  
  5.   
  6. - (void)setBackgroundProcessWidth:(CGFloat)width Color:(UIColor *)color {  
  7.     [self.backgroundLayer setLineWidth:width];  
  8.     [self.backgroundLayer setBackgroundColor:[color CGColor]];  
  9. }  

  • 接下来就是重点实现部分了,先从环形进度条的动画开始切入:
[objc]  view plain  copy
  1. #pragma mark - count methods  
  2.   
  3. - (void)startCount {  
  4.     //将总时长细分成小时、分钟和秒,并按规定格式00:00:00显示出来  
  5.     remain = duration;  
  6.     hour = (remain / 3600);  
  7.     minute = (remain / 60) % 60;  
  8.     second = (remain % 60);  
  9.     [self.timeLabel setText:[NSString stringWithFormat:@"%02d:%02d:%02d", hour, minute, second]];  
  10.       
  11.     [self startAnimation];  
  12.       
  13.     if ([countDownTimer isValid]) {  
  14.         [countDownTimer invalidate];  
  15.     }  
  16.     //开辟一个线程用于执行countDown方法,每一秒执行一次并一直重复下去。  
  17.     countDownTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(countDown) userInfo:nil repeats:YES];  
  18. }  
  19.   
  20. - (void)pauseCount {  
  21.     [self pauseAnimation];  
  22.       
  23.     [countDownTimer invalidate];  
  24. }  
  25.   
  26. - (void)resumeCount {  
  27.     [self resumeAnimation];  
  28.       
  29.     [countDownTimer fire];  
  30. }  
  31.   
  32. - (void)stopCount {  
  33.     remain = 0;  
  34.       
  35.     [self stopAnimation];  
  36.       
  37.     [countDownTimer invalidate];  
  38.     [self countDown];  
  39. }  
  40.   
  41. - (void)countDown {  
  42.     //剩余时间进行自减  
  43.     remain--;  
  44.     if (remain < 0) {  
  45.         //完成倒计时  
  46.         remain = 0;  
  47.         [countDownTimer invalidate];  
  48.           
  49.         [self.timeLabel setText:@"00:00:00"];  
  50.         //调用委托方法finishedCountDown  
  51.         [delegate performSelector:@selector(finishedCountDown)];  
  52.     }  
  53.     else {  
  54.         //将剩余时间转换成时分秒  
  55.         hour = (remain / 3600);  
  56.         minute = (remain / 60) % 60;  
  57.         second = (remain % 60);  
  58.           
  59.         //然后显示在timeLabel上  
  60.         [self.timeLabel setText:[NSString stringWithFormat:@"%02d:%02d:%02d", hour, minute, second]];  
  61.     }  
  62.       
  63.     NSLog(@"%d", remain);  
  64. }  

基本内容到此都实现完成,还有两个方法setTitleFontSize和setTimeFontSize读者可以自己去试着编写(作者又偷懒了!怎么?就是这么任性...)。

3. 跑一遍

写到这其实发现内容也不多的吧......总算可以来看看成果了。
  • 新建一个视图控制器,打开.m文件,在顶部导入GYCCircularTimer.h文件后添加如下代码:
[objc]  view plain  copy
  1. @interface GYCCircularTimerViewController () <CircularTimerDelegate>{  
  2.     GYCCircularTimer *cTimer;  
  3.     UIButton *cButton;  
  4. }  


  • 再在viewDidLoad中进行编写,代码参照下面:
[objc]  view plain  copy
  1. cTimer = [[GYCCircularTimer alloc] initWithCenter:CGPointMake(160, 160)  
  2.                                                Radius:100  
  3.                                             PathWidth:5  
  4.                                             PathColor:[UIColor brownColor]  
  5.                                             Clockwise:YES  
  6.                                                 Title:@"完成倒计时"  
  7.                                                  Hour:0  
  8.                                                Minute:0  
  9.                                                Second:10];  
  10.     cTimer.delegate = self;  
  11.     [cTimer setBackgroundProcessWidth:11 Color:[UIColor darkGrayColor]];  
  12.     [cTimer setForegroundProcessWidth:9 Color:[UIColor whiteColor]];  
  13.     [cTimer.titleLabel setFont:[UIFont systemFontOfSize:12]];  
  14.     [cTimer.titleLabel setTextColor:[UIColor lightGrayColor]];  
  15.     [cTimer.titleLabel setBackgroundColor:[UIColor clearColor]];  
  16.     [cTimer.timeLabel setFont:[UIFont boldSystemFontOfSize:18]];  
  17.     [cTimer.timeLabel setTextColor:[UIColor darkGrayColor]];  
  18.     [cTimer.timeLabel setBackgroundColor:[UIColor clearColor]];  
  19.     [self.view addSubview:cTimer];  
  20.       
  21.     cButton = [[UIButton alloc] initWithFrame:CGRectMake(40, 320, 240, 40)];  
  22.     [cButton setTitle:@"开始" forState:UIControlStateNormal];  
  23.     [cButton setBackgroundColor:[UIColor darkGrayColor]];  
  24.     [cButton addTarget:self action:@selector(clickedToStart) forControlEvents:UIControlEventTouchUpInside];  
  25.     [self.view addSubview:cButton];  

  • 定义个开始倒计时和暂停的方法:
[objc]  view plain  copy
  1. - (void)clickedToStart {  
  2.     NSLog(@"开始记时...");  
  3.     [cTimer startCount];  
  4.       
  5.     [cButton setTitle:@"暂停" forState:UIControlStateNormal];  
  6.     [cButton setBackgroundColor:[UIColor lightGrayColor]];  
  7.     [cButton removeTarget:self action:@selector(clickedToStart) forControlEvents:UIControlEventTouchUpInside];  
  8.     [cButton addTarget:self action:@selector(clickedToPause) forControlEvents:UIControlEventTouchUpInside];  
  9. }  
  10.   
  11. - (void)clickedToPause {  
  12.     NSLog(@"暂停");  
  13.     [cTimer pauseCount];  
  14.       
  15.     [cButton setTitle:@"重新开始" forState:UIControlStateNormal];  
  16.     [cButton setBackgroundColor:[UIColor darkGrayColor]];  
  17.     [cButton removeTarget:self action:@selector(clickedToPause) forControlEvents:UIControlEventTouchUpInside];  
  18.     [cButton addTarget:self action:@selector(clickedToStart) forControlEvents:UIControlEventTouchUpInside];  
  19. }  

  • 实现GYCCircularTime类的代理方法:
[objc]  view plain  copy
  1. #pragma mark - circular timer delegate  
  2.   
  3. - (void)finishedCountDown {  
  4.     NSLog(@"完成倒计时");  
  5.       
  6.     [cButton setTitle:@"开始" forState:UIControlStateNormal];  
  7.     [cButton setBackgroundColor:[UIColor darkGrayColor]];  
  8.     [cButton removeTarget:self action:@selector(clickedToPause) forControlEvents:UIControlEventTouchUpInside];  
  9.     [cButton addTarget:self action:@selector(clickedToStart) forControlEvents:UIControlEventTouchUpInside];  
  10. }  

完成后,就可以编译运行!

----------------------------------------------------------------------------------------华丽分割线------------------------------------------------------------------------------
文章有错之处,自行改之,不要指正(就是这么傲娇还带卖萌的...啧啧),让“我”安静得当一个美男子吧!
完!!!

源码下载地址: https://github.com/ganyuchuan/GYCBox,详见GYCCircularTimer。
请别猛戳!!!
ios 圆环倒计时的demo 倒计时demo,可以选择想要的时间进行圆环倒计时!很方便的demo!特别实用! 立即下载

相关推荐

ios-倒计时圆环(仿滴滴打车).zip

倒计时圆环 仿滴滴打车 github地址:https://github.com/wjTime/WJTimeCircleDemo

「OC」Timer单例模式倒计时和正向计时

Objective-C Timer单例模式倒计时和正向计时

danjiujiaohun的博客 693

ios-圆形进度条展示倒计时.zip

结合进度条封装的一款倒计时控件,可对计时开始,计时中及计时完成后做出相应事件的处理

ios xcode 定时器_GitHub - ZhenKaiJia/Timer: iOS常用计时器包括NSTimer、CADisplayLink、GCD定时器。主要介绍三种定时器的使用,以及全局定时器...

一、介绍iOS常用计时器包括NSTimer、CADisplayLink、GCD定时器。本次主要介绍三种定时器的使用,以及全局定时器的封装。过程主要涉及知识点定时器、多线程、锁、消息转发。二、使用1、Timer第一种 这种会导致循环引用,因为self强引用timer,timer强引用target,会导致定时器释放失败。self.timer = Timer.scheduledTimer(timeInt...

weixin_39936310的博客 504

IOS 圆形倒计时

IOS 圆形倒计时,可自定义的倒计时。

swift-SRCountdownTimer这是一个简单的iOS圆形倒计时拥有可配置的定时器

SRCountdownTimer 这是一个简单的iOS圆形倒计时拥有可配置的定时器

oc实现倒计时(带圆圈)

.h文件 #import <UIKit/UIKit.h> //宽 #define LINEWIDTH 5 //总时间 //#define ALLTOTALTIME 61 //定时器时间 #define TIMER 1 typedef NS_ENUM(NSInteger,CircularProgressViewType) { CircularProgressViewType_Label = 0, CircularProgressViewTyp...

qq_41620230的博客 561

武汉大学朱玉贤院士团队再发Nature Genetics,阐述棉花独特折叠胚胎形成的分子调控与演化机制

武汉大学朱玉贤院士团队再发Nature Genetics,阐述棉花独特折叠胚胎形成的分子调控与演化机制。

Pangenes的博客 1335

IOS开发之——倒计时(13)

一 概述 本文分别介绍如何在OC和Swift中实现倒计时功能: OC中实现倒计时的类是NSTimer Swift中实现倒计时的类是Timer 二 效果图 三 代码实现 3.1 OC模式下(ViewController.m) #import "ViewController.h" ​ @interface ViewController () @property (weak, nonatomic) IBOutlet UILabel *counterLabel; @prope.

我的博客 820

MATLAB语言的并发编程

并发编程是指在同一程序中同时执行多个计算任务。通过将任务分解为较小的子任务,程序可以利用多核处理器的优势,提高计算效率。并发编程与并行编程密切相关,但不完全相同。并行编程强调任务的同时执行,而并发编程则侧重于任务的调度与管理,即使某些任务并没有同时执行。MATLAB的并发编程为数据分析、科学计算等应用提供了强大的支持。通过使用parforparfevalspmd等工具,用户可以轻松实现高效的并行计算。尽管MATLAB的并发编程工具相对简单易用,但在实际应用中仍需关注数据共享、通信、错误处理等问题。

2501_90485575的博客 364

CAD文件转换避坑指南:Inventor导出STP时这些设置千万别忽略

本文深入解析了使用Autodesk Inventor导出STP文件时的关键设置与避坑指南。重点探讨了应用协议选择、样条曲线拟合精度对几何保真度的影响,以及装配体结构和元数据的保全策略,旨在帮助用户实现高质量、零误差的CAD数据交付,避免下游软件打开时出现特征丢失或曲面破碎等问题。

weixin_29214559的博客 518

[翻译] UI元素 – 控件 (Controls) – 人机交互指南 for iOS7

原文地址: 活动指示器 (Activity Indicator) 活动指示器表示任务或进程正在进行中 (如下图和文字标签一起使用). API NOTE 想了解如何在代码中定义活动指示器, 请参考 UIActivityIndicatorView Class Reference. 活动指示器是: 当任务进行和加载时旋转, 任务完成后自动消失用户无法与之交互 在工具栏

iOS程序媛的专栏 1420

vcenter server6.0上vmware inventory 、virtualvcenter等服务无法开启

描述:一天,vcenter访问不了,因此Windows远程到vcenter server上。相关服务未开启,开启virtualCenter server服务提示相关依赖服务未开启,于是开启依赖项服务Inventory服务报错。然后打算使用 C:\Program Files\VMware\vCenter Server\bin\servcivce-control来开启vmware服务 1....

Pespi_Co1a的博客 3067

鸿蒙ArkTS零基础开发倒计时器实战

随着鸿蒙操作系统生态的不断完善,基于ArkTS的声明式UI开发已经成为高校移动应用开发课程、前端跨端开发入门的核心必修内容。相较于传统的Android、iOS原生开发,鸿蒙ArkUI声明式开发拥有代码简洁、逻辑清晰、数据驱动视图、学习成本低、跨设备适配性强等诸多优势,非常适合零基础大学生入门学习。在鸿蒙入门级实训项目中,

weixin_46803111的博客 384

OSPF规划两大模型:双塔奇兵、犬牙交错

大家好,今天给大家带来的是OSPF规划两大模型:双塔奇兵、犬牙交错,让我们直接开始吧! OSPF规划之双塔奇兵 说明: OSPF 如果某个区域存在两个 ABR,并且在两个 ABR 上都对 area n 内的路由做了聚合操作。 最佳配置: 两台ABR之间的红线应该使用以太网的子接口技术,一个子接口属于area0,另一个属于 area n;或者该链路规划为 area n,同时配置虚连接; ABR 的 loopback0 规划入 area 0 OSPF 规划之犬牙交错 说明: 有时接入层的设备会以乱序的

网络技术联盟站 2423

计算机毕设项目十四:美团酒店评论情感分析完整数据代码-可直接运行

计算机毕设项目十四:美团酒店评论情感分析完整数据代码-可直接运行

693

选择某行某列的元素_iOS 人机界面指南精简版笔记之界面元素:Controls(下)

最近仔细研读了苹果官网最新的设计规范。网上没有找到很满意的翻译版本,于是自己老老实实的啃了几遍官方文档,顺便把学习笔记输出给大家分享一下。这里有几点要提醒一下大家:这是简明笔记,只选了重点内容,不是通篇逐字逐句的翻译。想要全面了解的同学建议认真学习官方文档。笔记没有完全按照官方的目录排序(官方二级目录按字母表顺序排列),而是根据重要程度、使用频率、相关性以及易混淆程度等,综合考量,重新排序如果有疏...

weixin_39787089的博客 285

【开发必备插件】iframe嵌套报“拒绝连接请求”的本地解决方法

关键词:iframe 拒绝连接、X-Frame-Options、Chrome 插件、前端调试、Allow X-Frame-Options前几天我在本地项目里调试一个第三方网站的嵌入页面时,遇到了一个非常经典的报错:xxx.com 拒绝了我们的连接请求。熟悉的老前端们一眼就知道——这是。但对于日常开发来说,我们经常需要在本地测试 iframe 嵌套外部页面(比如嵌第三方登录页、支付页、可视化报表系统等)。而线上站点配置了或DENY时,就会直接导致 iframe 加载失败。

代码简单说 Vue、JAVA、PHP、Node.js 熟练运用,接口、架构、性能全搞定。 1540

iOS开发之基础视图—— UIDatePicker

UIDatePicker 是一个控制器类,封装了 UIPickerView,但是他是UIControl的子类,专门用于接受日期、时间和持续时长的输入。日期选取器的各列会按照指定的风格进行自动配置,这样就让开发者不必关心如何配置表盘这样的底层操作。你也可以对其进行自定义,令其使用任何范围的日期。        继承UIControl。// // ViewController.m // UIDa

panjican的博客 925

把 ST03 的历史数据留得更久:ABAP Workload 统计保留期设置、原理与落地避坑指南

SAP ST03性能数据保留期配置指南 ST03/ST03N是SAP系统性能分析的核心工具,但默认数据保留期通常较短(3个月左右),难以满足跨季度对比、年度规划等需求。本文详细解析了ST03数据保留期的配置方法及注意事项: 数据存储机制:性能数据存储在监控库中,通过定期重组作业清理过期数据 配置路径:7.0+系统在"Workload Collector Database→Reorganization→Control"中按Profile分别设置 关键限制:保留期最大值建议不超过99,否则可

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 218

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

JDFlipNumberView:打造iOS炫酷翻页数字动画的终极指南

JDFlipNumberView是一款专为iOS开发者设计的翻页数字动画库,能够实现类似机场或火车站显示屏的炫酷翻页数字效果,完美支持Swift和SwiftUI。无论是构建倒计时器、计数器还是数据可视化界面,这款轻量级工具都能帮助你轻松实现专业级动画效果。 ## 为什么选择JDFlipNumberView? 在移动应用开发中,数字展示往往显得单调乏味。JDFlipNumberView通过模拟真

gitblog_01096的博客 1032

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

iOS实现倒计时显示 时 分 秒

1.创建一个类继承自UILabel.(用来显示 时 分 秒) .h文件 #import @interface TimeLable : UILabel @property (nonatomic,assign)NSInteger second; @property (nonatomic,assign)NSInteger minute; @property (nonatomic,as

Lea__DongYang的博客 4085

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

jq根据文本内容找到元素_iOS 人机界面指南精简版笔记之界面元素:Controls(下)...

最近仔细研读了苹果官网最新的设计规范。网上没有找到很满意的翻译版本,于是自己老老实实的啃了几遍官方文档,顺便把学习笔记输出给大家分享一下。这里有几点要提醒一下大家:这是简明笔记,只选了重点内容,不是通篇逐字逐句的翻译。想要全面了解的同学建议认真学习官方文档。笔记没有完全按照官方的目录排序(官方二级目录按字母表顺序排列),而是根据重要程度、使用频率、相关性以及易混淆程度等,综合考量,重新排序如果有疏...

weixin_39710966的博客 114

Flutter 框架跨平台鸿蒙开发 - 倒计时秒表:打造多功能计时工具

倒计时秒表是一款集倒计时、秒表和快速计时器于一体的多功能计时应用。通过简洁直观的界面和丰富的功能,满足用户在不同场景下的计时需求,如工作专注、运动计时、烹饪提醒等。 运行效果图 倒计时秒表倒计时器秒表快速计时器时间设置快捷按钮圆形进度暂停/继续重置功能开始/暂停计次记录重置功能毫秒精度预设场景自定义添加一键启动场景图标倒计时器支持自定义时间设置,适用于各种需要定时提醒的场景。功能特点:时间选择器实现: 倒计时逻辑: 进度显示: 2. 秒表功能 秒表提供精确到10毫秒的计时,支持计次记录。功能特点:秒表

2301_80888339的博客 698

iOS 开发之环形倒计时进度条(虚线/实线)

代码很简单,一看便知。这里为顺时针,若想要逆时针,clockwise改为0,还需更改起始角度和终点角度。 源码地址:https://github.com/LfyDragon/CountDown 直接上代码:- (void)drawRect:(CGRect)rect { CAShapeLayer *shapeLayer = [CAShapeLayer layer]...

weixin_30782331的博客 499
上一篇: 20160513 如何查看真机的沙盒(图文教程)
下一篇: iOS 9适配技巧
iOS_Water
博客等级 码龄12年 8粉丝 25原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值