第一个APP 时钟
// ViewController.h
// IOS310803
//
// Created by 张艳锋 on 15/8/3.
// Copyright (c) 2015年 zyf. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController<UIPickerViewDelegate,UIPickerViewDataSource,UIAlertViewDelegate,UIActionSheetDelegate>
{
//顶部
UILabel *lable;//你好时间
//中部
//闹钟
UIView *clockview;
UIScrollView *clockscrollView;//存放lable,lable记录已经添加的按钮
NSString *path;
UILabel *clocklablenow;//现实时间显示标签.通过闹钟记录字符串与标签内容字符串进行比较,如果相同闹钟响;
UIButton *colckbutton1;
UIButton *colckbutton2;
UITextField *aclock;//提示框中的文本输入框
NSMutableArray *clocklist;
//秒表
UILabel * mblable;
UIButton * mbbutton1;
UIButton * mbbutton2;
//计时器
UIView *jsview;
UIPickerView *jspickview;
UILabel *jslable;
UIButton *jsbutton1;
UIButton *jsbutton2;
BOOL isClick1;
BOOL isClick2;
NSInteger a,b,c,mus;
//尾部
}
@end
//
// ViewController.m
// IOS310803
//
// Created by 张艳锋 on 15/8/3.
// Copyright (c) 2015年 zyf. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
static int t=0;
- (void)viewDidLoad {
[super viewDidLoad];
//全局背景
self.view.backgroundColor=[UIColor lightGrayColor];
//顶部的lable
lable=[[UILabel alloc]initWithFrame:CGRectMake(0, 20, 375, 80)];
lable.backgroundColor=[UIColor lightGrayColor];
//背景色,字体及居中
[lable setText:@"时间,你好"];
[lable setTextAlignment:NSTextAlignmentCenter];
[self.view addSubview:lable];
//中部(0,100,375,500)
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(timerAction:) userInfo:nil repeats:YES];
int x=4;
int y=2;
NSLog(@"%d,%d",x%y,x/y);
//底部
/***************UISegmentedControl***************************/
NSArray *segmentedArray = [[NSArray alloc]initWithObjects:@"世界时钟",@"闹钟",@"秒表",@"计时器",nil];
//初始化UISegmentedControl
UISegmentedControl *segmentedControl = [[UISegmentedControl alloc]initWithItems:segmentedArray];
segmentedControl.frame = CGRectMake(0, 600, 375, 67);
segmentedControl.backgroundColor=[UIColor whiteColor];
segmentedControl.tintColor = [UIColor redColor];
//添加委托方法
[segmentedControl addTarget:self action:@selector(segmentAction:)forControlEvents:UIControlEventValueChanged];
[self.view addSubview:segmentedControl];
}
-(void)segmentAction:(UISegmentedControl *)Seg{
NSInteger Index = Seg.selectedSegmentIndex;
NSLog(@"Index %li", (long)Index);
switch (Index) {
case 0:
{
lable.text=@"世界时钟";
}
break;
case 1:
{
lable.text=@"闹钟";
//第一层页面,底层view
//添加中部视图底板
clockview=[[UIView alloc]init];
clockview.frame=CGRectMake(0, 100, 375, 500);
clockview.backgroundColor=[UIColor blackColor];
[self.view addSubview:clockview];
//第二层,时间抓取器+显示时间的标签(底部200像素空余)
//抓取时间的时间选择器
//最下面一排添加按钮
colckbutton1=[[UIButton alloc]init];
colckbutton1.frame=CGRectMake(50, 320, 100, 100);
colckbutton1.layer.masksToBounds=YES;
colckbutton1.layer.cornerRadius=mbbutton1.frame.size.width/2;
colckbutton1.backgroundColor=[UIColor greenColor];
[colckbutton1 setTitle:@"添加" forState:UIControlStateNormal];
[colckbutton1 setTitleColor:[UIColor blueColor] forState:UIControlStateNormal ];//平时颜色
[colckbutton1 setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted ];//点击时颜色
colckbutton2=[[UIButton alloc]init];
colckbutton2.frame=CGRectMake(225, 320, 100, 100);//大小
colckbutton2.layer.masksToBounds=YES;
colckbutton2.layer.cornerRadius=mbbutton2.frame.size.width/2;//圆形
colckbutton2.backgroundColor=[UIColor greenColor];
[colckbutton2 setTitle:@"删除" forState:UIControlStateNormal];
[colckbutton2 setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
[colckbutton2 setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted ];
//添加事件
[colckbutton1 addTarget:self action:@selector(addClock) forControlEvents:UIControlEventTouchUpInside];
[colckbutton2 addTarget:self action:@selector(deleteClock) forControlEvents:UIControlEventTouchUpInside];
[clockview addSubview:colckbutton1];
[clockview addSubview:colckbutton2];
}
break;
case 2:
{
lable.text=@"秒表";
//添加jsview,lable,按钮1,按钮2;
UIView * mbview=[[UIView alloc]init];
mbview.frame=CGRectMake(0, 100, 375, 500);
mbview.backgroundColor=[UIColor grayColor];
[self.view addSubview:mbview];
//lable便签
mblable=[[UILabel alloc]init];
mblable.frame=CGRectMake(0, 40, 375, 160);
mblable.backgroundColor=[UIColor brownColor];//设背景为白色
mblable.textAlignment=NSTextAlignmentCenter;//设置文字居中
mblable.textColor=[UIColor blackColor];//设置字体为黑色
mblable.font=[UIFont systemFontOfSize:50 weight:2];//字体大小,粗细
[mbview addSubview:mblable];
//按钮1,按钮2
mbbutton1=[[UIButton alloc]init];
mbbutton1.frame=CGRectMake(50, 320, 100, 100);
mbbutton1.layer.masksToBounds=YES;
mbbutton1.layer.cornerRadius=mbbutton1.frame.size.width/2;
mbbutton1.backgroundColor=[UIColor greenColor];
[mbbutton1 setTitle:@"启动" forState:UIControlStateNormal];
[mbbutton1 setTitleColor:[UIColor blueColor] forState:UIControlStateNormal ];//平时颜色
[mbbutton1 setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted ];//点击时颜色
mbbutton2=[[UIButton alloc]init];
mbbutton2.frame=CGRectMake(225, 320, 100, 100);//大小
mbbutton2.layer.masksToBounds=YES;
// mbbutton2.layer.cornerRadius=mbbutton2.frame.size.width/2;//圆形
mbbutton2.backgroundColor=[UIColor greenColor];
[mbbutton2 setTitle:@"重置" forState:UIControlStateNormal];
[mbbutton2 setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
[mbbutton2 setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted ];
//添加事件
[mbbutton1 addTarget:self action:@selector(startOrstop:) forControlEvents:UIControlEventTouchUpInside];
[mbbutton2 addTarget:self action:@selector(reSet:) forControlEvents:UIControlEventTouchUpInside];
[mbview addSubview:mbbutton1];
[mbview addSubview:mbbutton2];
a=0;
b=0;
c=0;
mus=0;
mblable.text=[NSString stringWithFormat:@"%ld:%ld:%ld",(long)a,(long)b,(long)c];
}
break;
case 3:
{
lable.text=@"计时器";
//添加jsview,时间选择器,lable,按钮1,按钮2;
jsview=[[UIView alloc]init];
jsview.frame=CGRectMake(0, 100, 375, 500);
jsview.backgroundColor=[UIColor blackColor];
jslable.textColor=[UIColor whiteColor];
[self.view addSubview:jsview];
//时间选择器
jspickview=[[UIPickerView alloc]init];
jspickview=[[UIPickerView alloc]initWithFrame:CGRectMake(0, 0, 375, 120)];
jspickview.dataSource=self;
jspickview.delegate=self;
jspickview.backgroundColor=[UIColor yellowColor];
[jsview addSubview:jspickview];
//lable便签
jslable=[[UILabel alloc]init];
jslable.frame=CGRectMake(0, 120, 375, 200);
jslable.backgroundColor=[UIColor blueColor];
jslable.textAlignment=NSTextAlignmentCenter;//设置文字居中
jslable.font=[UIFont systemFontOfSize:50 weight:5];//设置字体大小粗细
[jsview addSubview:jslable];
//按钮1,按钮2
jsbutton1=[[UIButton alloc]init];
jsbutton1.frame=CGRectMake(50, 320, 100, 100);
jsbutton1.layer.masksToBounds=YES;
jsbutton1.layer.cornerRadius=jsbutton1.frame.size.width/2;
jsbutton1.backgroundColor=[UIColor greenColor];
[jsbutton1 setTitle:@"开始计时" forState:UIControlStateNormal];
[jsbutton1 setTitleColor:[UIColor blueColor] forState:UIControlStateNormal ];//平时颜色
[jsbutton1 setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted ];//点击时颜色
jsbutton2=[[UIButton alloc]init];
jsbutton2.frame=CGRectMake(225, 400, 60, 60);//大小
jsbutton2.layer.masksToBounds=YES;
jsbutton2.layer.cornerRadius=jsbutton2.frame.size.width/2;//圆形
jsbutton2.backgroundColor=[UIColor greenColor];
[jsbutton2 setTitle:@"暂停" forState:UIControlStateNormal];
[jsbutton2 setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
[jsbutton2 setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted ];
//添加事件
[jsbutton1 addTarget:self action:@selector(startOrcancel:) forControlEvents:UIControlEventTouchUpInside];
[jsbutton2 addTarget:self action:@selector(suspendedOrcontinue:) forControlEvents:UIControlEventTouchUpInside];
[jsview addSubview:jsbutton1];
[jsview addSubview:jsbutton2];
}
break;
default:
break;
}
}
#pragma mark 世界时钟
//定时器运行
-(void)timerAction:(NSTimer *)timer{
t+=1;
if (t==100) {
t=0;
}
//世界时钟完成
if ([lable.text isEqualToString:@"世界时钟"]&&t==99) {
UIView *wtview=[[UIView alloc]init];
wtview.tag=10;
wtview.frame=CGRectMake(0, 100, 375, 500);
wtview.backgroundColor=[UIColor greenColor];
[self.view addSubview:wtview];
//抓取时间的时间选择器
UIDatePicker *wtdatePicker=[[UIDatePicker alloc]initWithFrame:CGRectMake(0, 0, 375, 200)];
wtdatePicker.tag=11;
wtdatePicker.backgroundColor=[UIColor redColor];//标记颜色便于观看
wtdatePicker.datePickerMode=UIDatePickerModeDateAndTime;
wtdatePicker.date=[NSDate date];
[wtview addSubview:wtdatePicker];
//显示时间标签
UILabel *wtlable=[[UILabel alloc]init];
wtlable.frame=CGRectMake(0, 200, 375, 200);
wtlable.tag=12;
wtlable.backgroundColor=[UIColor blueColor];
wtlable.textAlignment=NSTextAlignmentCenter;//设置文字居中
NSDateFormatter *formatter=[[NSDateFormatter alloc]init];
formatter.dateFormat=@"YYYY-MM-dd hh:mm:ss aaa";
wtlable.text=[formatter stringFromDate:wtdatePicker.date];
[wtview addSubview:wtlable];
}
//闹钟
else if ([lable.text isEqualToString:@"闹钟"]&&t==99){
UIDatePicker *clockdatePicker=[[UIDatePicker alloc]initWithFrame:CGRectMake(0, 0, 375, 200)];
clockdatePicker.datePickerMode=UIDatePickerModeTime;//只要时间不要日期
clockdatePicker.date=[NSDate date];//获取现在时间
[clockview addSubview:clockdatePicker];
//显示时间标签
clocklablenow=[[UILabel alloc]init];
clocklablenow.frame=CGRectMake(0, 200, 375, 100);
clocklablenow.textAlignment=NSTextAlignmentCenter;//设置文字居中
NSDateFormatter *formatter=[[NSDateFormatter alloc]init];
formatter.dateFormat=@"HH:mm:ss";//从弹窗输入的冒号为中文式样此处也设为中文式样方便比对
clocklablenow.text=[formatter stringFromDate:clockdatePicker.date];
NSLog(@"%@",clocklablenow.text);
[clockview addSubview:clocklablenow];
//第三层页面上部由可滚动视图占领(遮盖住了第二层的时间抓取器和时间显示标签),下部由一串按钮组成(占满视图无空余)
clockscrollView=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 375, 300)];
//获取plist文件里面已经设置好的按钮
path=@"/Users/scjy/Desktop/cx/IOS/IOS310803/IOS310803/Clockmemory List.plist";
clocklist=[NSMutableArray arrayWithContentsOfFile:path];
//设置有效区域大小,有多少个lable按需求设置
clockscrollView.contentSize=CGSizeMake(375, (62*clocklist.count) );//有效的显示区域
//此处
clockscrollView.backgroundColor=[UIColor redColor];
[clockview addSubview:clockscrollView];//将可滚动视图框添加到底部view上面
//将每一条记录都通过一个一个标签添加到可滚动视图框中
for (int i=0; i<clocklist.count; i++) {
//获取第I个闹钟记录字符串
NSString *alist=[clocklist objectAtIndex:i];
//创建第I个lable
UILabel *clocklable=[[UILabel alloc]initWithFrame:CGRectMake(0, 62*i, 375, 60)];
//将闹钟记录字符串设置为标签的文本内容
clocklable.text=alist;
//将背景设为白色
clocklable.backgroundColor=[UIColor whiteColor];
//用超细的带背景色视图带色添加间隔线
UIView *redview1 = [[UIView alloc]initWithFrame:CGRectMake(0,(60+62*i), 375, 2)];
redview1.backgroundColor = [UIColor redColor];
[clockscrollView addSubview:redview1];
//将字体设为黑色
clocklable.textAlignment=NSTextAlignmentCenter;//设置文字居中
clocklable.textColor=[UIColor blackColor];
//将闹钟记录添加到滚动视图框中
[clockscrollView addSubview:clocklable];
//如果闹钟时间和抓取现实时间相等,跳出弹窗,以后可以播放音乐什么的
if ([clocklable.text isEqualToString:clocklablenow.text]) {
UIAlertView *alertView=[[UIAlertView alloc]initWithTitle:nil message:@"时间到,主人" delegate:self cancelButtonTitle:@"知道了" otherButtonTitles:nil, nil];
[alertView show];
}
}
}
//秒表完成
else if ([lable.text isEqualToString:@"秒表"]){
if ([mbbutton1.titleLabel.text isEqualToString:@"停止"]) {
mus+=1;
a=mus/6000;
b=(mus%6000)/100;
c=mus%100;
mblable.text=[NSString stringWithFormat:@"%ld分%ld秒%ld",(long)a,(long)b,(long)c];
}
}
//计时器完成
else if([lable.text isEqualToString:@"计时器"]&&t==99){
if ([jsbutton1.titleLabel.text isEqualToString:@"取消"]&&[jsbutton2.titleLabel.text isEqualToString:@"暂停"]) {
mus=a*3600+b*60+c;
if (mus==0) {
jslable.text=@"时间到";
//时间到后,时间选择器回归到00:00:00
jspickview=[[UIPickerView alloc]init];
jspickview=[[UIPickerView alloc]initWithFrame:CGRectMake(0, 0, 375, 120)];
jspickview.dataSource=self;
jspickview.delegate=self;
jspickview.backgroundColor=[UIColor yellowColor];
[jsview addSubview:jspickview];
//此处可以加弹窗
[jsbutton1 setTitle:@"开始计时" forState:UIControlStateNormal];
isClick1=NO;
}
else if(mus<0){
mus=0;
}
else{
mus-=1;
a=mus/3600;
b=(mus%3600)/60;
c=mus%60;
NSLog(@"%ld:%ld:%ld:%ld",a,b,c,mus);
jslable.text=[NSString stringWithFormat:@"%ld:%ld:%ld",(long)a,(long)b,(long)c];
}
}
}
}
#pragma mark 闹钟
/************************************************************/
//弹框(没有使用)
-(void)addClock
{
UIAlertView *alertView=[[UIAlertView alloc]initWithTitle:@"提示" message:@"设置时" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alertView.delegate=self;
//添加输入框
alertView.alertViewStyle=UIAlertViewStylePlainTextInput;
aclock=[alertView textFieldAtIndex:0];
//提示信息
aclock.placeholder=@"00:00:00";
[alertView show];//弹框
//获取
}
//alertView上面的按钮点击事件(没有使用)
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 1) {
NSLog(@"sure");
clocklist=[NSMutableArray arrayWithContentsOfFile:path];
//添加
[clocklist addObject:aclock.text];
//写入
[clocklist writeToFile:path atomically:YES];
}
}
-(void)deleteClock{
clocklist=[NSMutableArray arrayWithContentsOfFile:path];
//初始化一个UIActionSheet
UIActionSheet *actionSheet1=[[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:nil, nil];
for (int i=0; i<clocklist.count; i++) {
[actionSheet1 addButtonWithTitle:[clocklist objectAtIndex:i]];
}
//添加到self.view中
[actionSheet1 showInView:self.view];
}
#pragma marks - UIActionSheetDelegate
//actionSheet上面的按钮点击事件
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
//获取源文件
clocklist=[NSMutableArray arrayWithContentsOfFile:path];
//移除一个
for (int i=1; i<clocklist.count+1; i++) {
//按钮从第一个开始的而不是从零开始的
//按钮的i对应clocklist的i-1;
if (buttonIndex==i) {
[clocklist removeObject:[clocklist objectAtIndex:i-1]];
//写入
[clocklist writeToFile:path atomically:YES];
break;
}
}
}
/************************************************************/
#pragma mark 秒表
-(void)startOrstop:(UIButton *)sender{
if (!isClick1) {
[mbbutton1 setTitle:@"停止" forState:UIControlStateNormal];
isClick1=YES;
}
else{
[mbbutton1 setTitle:@"启动" forState:UIControlStateNormal];
isClick1=NO;
}
}
-(void)reSet:(UIButton *)sender{
[mbbutton1 setTitle:@"启动" forState:UIControlStateNormal];
isClick1=NO;
a=0;
b=0;
c=0;
mus=0;
mblable.text=[NSString stringWithFormat:@"%ld:%ld:%ld",(long)a,(long)b,(long)c];
}
/************************************************************/
#pragma mark 计时器
//选择器PickerView
//行数
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 6;
}
//列数
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
if (component==0) {//第一列12行
return 24;
}
else if (component==1){//第二列1行
return 1;
}
else if (component==2){
return 60;
}
else if (component==3){
return 1;
}
else if (component==4){
return 60;
}
else
return 1;
}
//设置每一行的标题
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
if (component==0) {
return [NSString stringWithFormat:@"%d",(int)row];
}
else if(component==1){
return @"时";
}
else if (component==2){
return [NSString stringWithFormat:@"%d",(int)row];
}
else if (component==3){
return @"分";
}
else if (component==4){
return [NSString stringWithFormat:@"%d",(int)row];
}
else
return @"秒";
}
//获取单元行的内容显示在lable中
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{//主要用于第一次获取
a=[pickerView selectedRowInComponent:0];
b=[pickerView selectedRowInComponent:2];
c=[pickerView selectedRowInComponent:4];
jslable.textColor=[UIColor whiteColor];
jslable.text=[NSString stringWithFormat:@"%ld:%ld:%ld",(long)a,(long)b,(long)c];
}
//按钮事件jsbutton1
//按钮自动默认为以NO开始;
-(void)startOrcancel:(UIButton *)sender{
if (!isClick1) {
NSLog(@"sd");
[jsbutton1 setTitle:@"取消" forState:UIControlStateNormal];
isClick1=YES;
[jsview addSubview:jsbutton1];
}
else{
NSLog(@"fs");
//点击取消后,时间选择器回归到00:00:00
jspickview=[[UIPickerView alloc]init];
jspickview=[[UIPickerView alloc]initWithFrame:CGRectMake(0, 0, 375, 120)];
jspickview.dataSource=self;
jspickview.delegate=self;
jspickview.backgroundColor=[UIColor yellowColor];
[jsview addSubview:jspickview];
//lable里面也回归00:00:00
a=[jspickview selectedRowInComponent:0];
b=[jspickview selectedRowInComponent:2];
c=[jspickview selectedRowInComponent:4];
jslable.text=[NSString stringWithFormat:@"%ld:%ld:%ld",(long)a,(long)b,(long)c];
//改变按钮title,重新添加
[jsbutton1 setTitle:@"开始计时" forState:UIControlStateNormal];
isClick1=NO;
[jsbutton2 setTitle:@"暂停" forState:UIControlStateNormal];
isClick2=NO;
}
}
//按钮事件jsbutton2
-(void)suspendedOrcontinue:(UIButton *)sender{
if ([jsbutton1.titleLabel.text isEqual:@"开始计时"]) {
}
else{
if (!isClick2) {
[jsbutton2 setTitle:@"继续" forState:UIControlStateNormal];
isClick2=YES;
[jsview addSubview:jsbutton2];
}
else{
[jsbutton2 setTitle:@"暂停" forState:UIControlStateNormal];
isClick2=NO;
[jsview addSubview:jsbutton2];
}
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
第一个APP 时钟的更多相关文章
- Android(4)—Mono For Android 第一个App应用程序
0.前言 年前就计划着写这篇博客,总结一下自己做的第一个App,却一直被新项目所累,今天抽空把它写完,记录并回顾一下相关知识点,也为刚学习Mono的同学提供佐证->C#也是开发Android的! ...
- Android-启动另一个app
直接上代码: // 通过包名获取要跳转的app,创建intent对象 Intent intent = getPackageManager().getLaunchIntentForPackage(&qu ...
- app使用微信支付成功后,点击返回到该app却跳到另外一个app去了
刚接手了公司iOS的两个APP, 现在碰到了这样一个问题: 有一台iPhone在一个APP中使用了微信支付,支付成功后,点击返回到该APP,结果却跳到了另外一个APP去了. 这两个APP都是公司开发的 ...
- 做一个 App 前需要考虑的几件事
做一个 App 前需要考虑的几件事 来源:limboy的博客 随着工具链的完善,语言的升级以及各种优质教程的涌现,做一个 App 的成本也越来越低了.尽管如此,有些事情最好前期就做起来,避免当 ...
- 后移动互联网时代:到底还要不要开发一个App?
后移动互联网时代,到底是什么样的一个时代? 首先,后移动互联网时代中,产生头部应用的几率变小了,像微信这样巨头式的App很难在产生第二个.其次,后移动互联网时代,物联网发展迅速,所有的智能硬件都需要一 ...
- APP开发:一个APP开发需要哪些技术人员?
亿合科技小编了解到:国民老公王思聪曾经在一个访谈中谈到过,如果他是一个普通人,他会选择移动互联网去创业,因为做个网站或者App开发门槛较低,做大做强的机会也比较多.小编觉得创业就是投资,重 ...
- 亲手使用Sencha Touch + phonepag开发Web APP随笔 -- 第一个APP
参考博文: [Phonegap+Sencha Touch] 移动开发1.准备工作 [Phonegap+Sencha Touch] 移动开发2.PhoneGap/Cordova初步使用 经过差不多1 ...
- 一个App Widget实例第一次创建时被调用
事实上已经有很多的所谓的路由框架做到这一点,我也没有去研究别的,加上一直对backbone这个框架的评价不错,所以就琢磨着怎么用它实现我所需要的SPA的url管理了. 比如,你可能会说"如果 ...
- Android Studio 1.0.2项目实战——从一个APP的开发过程认识Android Studio
Android Studio 1.0.1刚刚发布不久,谷歌紧接着发布了Android Studio 1.0.2版本,和1.0.0一样,是一个Bug修复版本.在上一篇Android Studio 1.0 ...
随机推荐
- mysqldump 安全 --skip-add-drop-table
[root@localhost data]# mysqldump -uroot --master-data=2 -p --single-transaction --skip-add-drop-ta ...
- window.location.Reload()和window.location.href 区别
首先介绍两个方法的语法: reload 方法,该方法强迫浏览器刷新当前页面.语法:location.reload([bForceGet])参数: bForceGet, 可选参数, 默认为 false, ...
- 关于Android中获取Intent里的数据
Intent获取数据和发送数据的办法: //直接通过Intent发送 intent.putExtra("name","wytings"); //直接通过Inte ...
- IIS 之 HTTP Error 404.2 – Not Found(ISAPI 和 CGI 限制)
对于很多B/S架构的软件来说,在IIS中添加ISAPI和CGI限制功能是非常必要的,因为如果在IIS中不添加添加ISAPI和CGI限制功能可能会引起软件运行过程中报错,或者直接就登录不了. 1.允许I ...
- Conversions
Problem Description Conversion between the metric and English measurement systems is relatively simp ...
- iOS 网络/本地 图片 按自定义比例缩放 不失真 方法
我尝试了很多种方法,终于,设计了一个方法,能按自己规定的大小压缩 还没失真 如果以后不好用 我再升级 分享给大家: + (CGRect )scaleImage:(UIImage *)image toS ...
- [Java] 遍历HashMap和HashMap转换成List的两种方式
遍历HashMap和HashMap转换成List /** * convert the map to the list(1) */ public static void main(String[] ...
- UIPickerView 简单操作和实际应用
1.UIPickerView 选择指示器控件 //选择器的初始化 UIPickerView * pickerView = [[UIPickerView alloc] initWithFrame:CGR ...
- Python一些难以察觉的错误
Python一些难以察觉的错误 今天把微博的收藏夹打开,发现以前很多收藏的好文章还没有细细研究,今天开始要慢慢研究总结总结.今天看的这篇文章地址: http://blog.amir.rachum.co ...
- oracle PL/SQL(procedure language/SQL)程序设计之游标cursors
游标 Cursors--Conception 每一条被Oracle服务器执行的SQL语句都有一个独立的游标与之相关联:隐式游标 Implicit cursors: 用于所有的DML和PL/SQL的SE ...