UI第九节——UIProgressView
- (void)viewDidLoad {
[super viewDidLoad];
// 实例化 UIProgressView,高度是固定的
UIProgressView *progressView = [[UIProgressView alloc] initWithFrame:CGRectMake(40, 100, 295, 30)];
#if 1
// 主题颜色
progressView.progressTintColor = [UIColor redColor];
progressView.trackTintColor = [UIColor greenColor];
#endif
#if 0 // 这个有BUG,不显示
// 图片
progressView.progressImage = [UIImage imageNamed:@"slider_track_min"];
progressView.trackImage = [UIImage imageNamed:@"slider_track_max"];
#endif
// 把progressView加到self.view上
[self.view addSubview:progressView];
// 启动一个定时器
[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerRunning:) userInfo:@{@"progressView": progressView} repeats:YES];
}
// 定时会调用一次这个函数
- (void)timerRunning:(NSTimer *)timer
{
UIProgressView *progressView = [timer.userInfo objectForKey:@"progressView"];
// 设置进度
progressView.progress += 0.1;
NSLog(@"%f", progressView.progress);
// 当进度条完全走完的时候,让定时器停掉
if (progressView.progress >= 1.0) {
// 销毁定时器
[timer invalidate];
}
}
UI第九节——UIProgressView的更多相关文章
- UI第九节——UIStepper
- (void)viewDidLoad { [super viewDidLoad]; // 实例化UIStepper,大小是固定的 UIStepper *stepper = ...
- JAVA 年轻代收集器 第九节
JAVA 年轻代收集器 第九节 继续上一章所讲的,STW即GC时候的停顿时间,他会暂停我们程序中的所有线程.如果STW所用的时间长而且次数多的话,那么我们整个系统稳定性以及可用性将大大降低. 因此我 ...
- centos 文档的压缩和打包 gzip,bzip2,xz,zip,unzip,tar,tgz 第九节课
centos 文档的压缩和打包 gzip,bzip2,xz,zip,unzip,tar,tgz 第九节课 SAS盘可以支持热插拔,看机器 tar.zip.tar -czvf 不会动源文件,gz ...
- 第九节: 利用RemoteScheduler实现Sheduler的远程控制 第八节: Quartz.Net五大构件之SimpleThreadPool及其四种配置方案 第六节: 六类Calander处理六种不同的时间场景 第五节: Quartz.Net五大构件之Trigger的四大触发类 第三节: Quartz.Net五大构件之Scheduler(创建、封装、基本方法等)和Job(创建、关联
第九节: 利用RemoteScheduler实现Sheduler的远程控制 一. RemoteScheduler远程控制 1. 背景: 在A服务器上部署了一个Scheduler,我们想在B服务器上 ...
- CUDA:Supercomputing for the Masses (用于大量数据的超级计算)-第九节
原文链接 第九节:使用CUDA拓展高等级语言 Rob Farber 是西北太平洋国家实验室(Pacific Northwest National Laboratory)的高级科研人员.他在多个国家级的 ...
- 《C Prime Plus》第九节笔记
第九节 函数 9.1 复习函数 函数原型 function prototype 函数调用 function call 函数定义 function definition 形参 实参 典型的ANSI C函 ...
- 【Android测试】【第九节】MonkeyRunner—— 初识
◆版权声明:本文出自胖喵~的博客,转载必须注明出处. 转载请注明出处:http://www.cnblogs.com/by-dream/p/4836815.html 不得不说两句,过了这么久才再次更新博 ...
- 第九节:基于MVC5+AutoFac+EF+Log4Net的基础结构搭建
一. 前言 从本节开始,将陆续的介绍几种框架搭建组合形式,分析每种搭建形式的优势和弊端,剖析搭建过程中涉及到的一些思想和技巧. (一). 技术选型 1. DotNet框架:4.6 2. 数据库访问:E ...
- UI第一节—— UILable
1.首先说说怎么创建UI程序,打开xcode,选择Create a new Xcode project.看如下截图 2,接下来就蹦出一个和写OC应用差不多的界面,不多解释了 3.我给工程取得名字就叫 ...
随机推荐
- [WPF系列]- Style - Specify width/height as resource in WPF
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys=" ...
- COGS743. [网络流24题] 最长k可重区间集
743. [网络流24题] 最长k可重区间集 ★★★ 输入文件:interv.in 输出文件:interv.out 简单对比时间限制:1 s 内存限制:128 MB «问题描述: «编 ...
- selenium自动化-java-封断言类2
封装断言类 package streamax.com; import java.util.ArrayList; import java.util.List; import org.testng.Ass ...
- Jquery揭秘系列:实现 ready和bind事件
讲这一节之前,先回顾之前的一篇<小谈Jquery>里面的代码: (function (win) { var _$ = function (selector, context) { retu ...
- 详解AsyncTask的使用
转载自:http://blog.csdn.net/liuhe688/article/details/6532519 在Android中实现异步任务机制有两种方式,Handler和AsyncTask. ...
- 认真理解 图片 <img> background-image
<img src="" width="" height="" alt=""> 一:图片的宽度和高度的关系? ...
- centos7 安装jdk1.8
安装之前下熟悉以下连个文件 (1)/etc/profile 全局(公有)配置,不管是哪个用户,登录时都会读取该文件. (2)~/.bashrc: 该文件包含专用于你的bash shell的bas ...
- 在servlet中用spring @Autowire注入
今天在改版以前应用程序的时候,发现很多系统是直接用servlet做的.当初也用到了spring,所以自然想到也用spring的@autowire注入来引入service层.但发现如果直接用,有时候成功 ...
- maven-各配置文件详解
1.setting.xml http://www.cnblogs.com/yangxia-test/p/4409736.html <?xml version="1.0" en ...
- C#汉字转拼音帮助类
using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressi ...