UI4_UIStepper与UIProgressView
//
// ViewController.m
// UI4_UIStepper与UIProgressView
//
// Created by zhangxueming on 15/7/7.
// Copyright (c) 2015年 zhangxueming. All rights reserved.
// #import "ViewController.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
//步进器(94*29)
UIStepper *step = [[UIStepper alloc] initWithFrame:CGRectMake(100, 200, 0, 0)];
NSLog(@"step = %@", step); //设置步进器的连续性
step.continuous = YES; //设置步长
step.stepValue = 0.01;
//设置最小值
step.minimumValue = 0;
//设置最大值
step.maximumValue = 1;
//
step.tintColor = [UIColor redColor];
//
[step setBackgroundImage:[UIImage imageNamed:@"truckmin"] forState:UIControlStateNormal];
//添加点击事件
[step addTarget:self action:@selector(stepValueChange:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:step]; //进度条
UIProgressView *progress = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];
progress.frame = CGRectMake(10, 400, self.view.frame.size.width-20, 10);
progress.tintColor = [UIColor cyanColor];
progress.trackTintColor = [UIColor redColor];
//进度
progress.progress = 0.0;
progress.tag = 100;
[self.view addSubview:progress]; } - (void)stepValueChange:(UIStepper *)step
{
NSLog(@"%.2f", step.value);
UIProgressView *progressView = (UIProgressView *)[self.view viewWithTag:100];
progressView.progress = step.value; } - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
} @end
UI4_UIStepper与UIProgressView的更多相关文章
- AFNetworking 3.0 源码解读(十一)之 UIButton/UIProgressView/UIWebView + AFNetworking
AFNetworking的源码解读马上就结束了,这一篇应该算是倒数第二篇,下一篇会是对AFNetworking中的技术点进行总结. 前言 上一篇我们总结了 UIActivityIndicatorVie ...
- UI第九节——UIProgressView
- (void)viewDidLoad { [super viewDidLoad]; // 实例化 UIProgressView,高度是固定的 UIProgressView ...
- Swift - 进度条(UIProgressView)的用法
1,创建进度条 1 2 3 4 var progressView=UIProgressView(progressViewStyle:UIProgressViewStyle.Default) progr ...
- UI中一些不常用的控件UIActivityIndicatorView、UIProgressView、UISegmentedControl、UIStepper、UISwitch、UITextView、UIAlertController
//UIActivityIndicatorView //小菊花,加载 #import "ActivityIndicatorVC.h" @interface ActivityIndi ...
- UIProgressView(进度条控件)
UIProgressView *pr=[[UIProgressView alloc]init]; pr.frame=CGRectMake(150.0, 190.0, 130.0, 30.0);//进度 ...
- UIProgressView和UISlider
UIProgressView和UISlider两个控件长的很像,区别在于UISlider有一个可以改变进度的滑块.虽然样子差不多,提供的属性的功能也差不多,但是属性的名字差别比较大. UIProgre ...
- iOS - UIProgressView
前言 NS_CLASS_AVAILABLE_IOS(2_0) @interface UIProgressView : UIView <NSCoding> @available(iOS 2. ...
- ios基础篇(七)——UISwich、UISlider、UIProgressView的用法总结
一.UISlider UIslider滑块控件在IOS开发中会常用到,可用于调节音量,字体大小等UI方面的交互:UISlider实例提供一个控件,让用户通过左右拖动一个滑块(可称其为“缩略图”)来选择 ...
- swift系统学习控件篇:UIProgressView+NSTimer+UIstepper+UIAlertController
工作之余,学习下swift大法.把自己的学习过程分享一下.当中的布局很乱,就表在意这些细节了.直接上代码: UIProgressView+NSTimer+UIstepper UIStepper UIP ...
随机推荐
- [Angular2 Router] CanDeactivate Route Guard - How To Confirm If The User Wants To Exit A Route
In this tutorial we are going to learn how we can to configure an exit guard in the Angular 2 Router ...
- iOS开发——UI篇Swift篇&玩转UItableView(一)基本使用
UItableView基本使用 class ListViewController: UIViewController , UITableViewDataSource, UITableViewDeleg ...
- BM25相关度打分公式
BM25算法是一种常见用来做相关度打分的公式,思路比较简单,主要就是计算一个query里面所有词和文档的相关度,然后在把分数做累加操作,而每个词的相关度分数主要还是受到tf/idf的影响.公式如下: ...
- Winform开发--控件
WinForm控件开发总结目录 WinForm控件开发总结目录 WinForm控件开发总结(一)------开篇 WinForm控件开发总结(二)------使用和调试自定义控件 WinForm控件开 ...
- set与hash_set
原文:http://blog.csdn.net/morewindows/article/details/7029587 STL系列之六 set与hash_set set和hash_set是STL中比较 ...
- 一款基于css3的3D图片翻页切换特效
今天给大家分享一款基于css3的3D图片翻页切换特效.单击图片下方的滑块会切换上方的图片.动起你的鼠标试试吧,效果图如下: 在线预览 源码下载 实现的代码. html代码: <div id= ...
- Golang学习 - reflect 包
------------------------------------------------------------ 在 reflect 包中,主要通过两个函数 TypeOf() 和 ValueO ...
- seleniu IDE 点点滴滴
在使用selenium webdriver +python 的过程中遇见了许多的问题,这些问题在网上都没有找到很好的答案,后来在看selenium IDE的时候发现这里面有很好的解决方法,写写.记记. ...
- Coin Test
描述 As is known to all,if you throw a coin up and let it droped on the desk there are usually three r ...
- java 转义字符
\t 相当于tab,缩进\n 回车\r 换行\b 换成 一个黑点