iOS学习笔记-001.第一个程序初体验
2017-01-17 10:01
369 查看
第一个程序初体验
一模拟器
二弹框和log
三拨打电话和发短信
四界面跳转
五动画
一模拟器
二弹框和log
三拨打电话和发短信
四界面跳转
五动画
第一个程序初体验
一、模拟器
command + shift + H 等同于 home 键 command + 1 大 command + 2 中 command + 3 小
二、弹框和log
@implementation ViewController - (IBAction)fristClick:(id)sender { //第一个点击效果 //1.打印log NSLog(@"hello ios one"); //2.弹框 //2.1定义一个对话框 UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"弹框" message:@"这是第一个弹框" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; //2.2显示出来 [alert show]; }
三、拨打电话和发短信
/* 打电话 */ - (IBAction)btn_call:(id)sender { //1 设置电话号码 NSURL * url = [NSURL URLWithString:@"tel://10086"]; //2 调用系统的拨号功能 [[UIApplication sharedApplication] openURL:url]; } /* 发短信 */ - (IBAction)btn_sms:(id)sender { //1 设置电话号码 NSURL * url = [NSURL URLWithString:@"sms://10086"]; //2 写短信 [[UIApplication sharedApplication] openURL:url]; }
四、界面跳转
五、动画
@implementation ViewController - (IBAction)btn_startAnimotion:(id)sender { //集合存储图片 NSMutableArray * array1 = [[NSMutableArray alloc] init]; //1.现在图片先 UIImage *image1 = [UIImage imageNamed:@"bee1.png"]; UIImage *image2 = [UIImage imageNamed:@"bee2.png"]; UIImage *image3 = [UIImage imageNamed:@"bee3.png"]; UIImage *image4 = [UIImage imageNamed:@"bee4.png"]; UIImage *image5 = [UIImage imageNamed:@"bee5.png"]; [array1 addObject:image1]; [array1 addObject:image2]; [array1 addObject:image3]; [array1 addObject:image4]; [array1 addObject:image5]; //2 播放动画 //2.1 添加动画的图片到UIImageView中 _toImageView.animationImages = array1; //2.2 设置动画的一些参数 _toImageView.animationDuration = 2; //2s _toImageView.animationRepeatCount = 3;//循环3次 //2.3 播放动画 [_toImageView startAnimating]; }
相关文章推荐
- iOS学习笔记7—程序实现国际化 (即本地多语言化)
- 2011斯坦福大学iOS应用开发教程学习笔记(第七课)Pad和iPhone的通用程序
- iOS学习笔记65-3D Touch开发初体验
- iOS学习笔记11—代码里打印程序所占用的内存
- iOS学习笔记(二.iOS程序执行流程)
- xamarin学习笔记B02(ios程序启动了解)
- 斯坦福大学公开课 iOS应用开发教程学习笔记(第六课)多个MVC的程序和故事版、UINavigationController、 Segues
- 2011斯坦福大学iOS应用开发教程学习笔记(第七课)Pad和iPhone的通用程序
- (转)IOS 学习笔记 2015-03-23 如何获取IOS程序的系统信息
- IOS学习笔记之七:第一个iphone小程序详解
- ((ios开发学习笔记五))手动创建Tab Bar Controller 程序
- (一)ios学习笔记--程序整体语法结…
- 黑马程序员——Objective-C程序设计(第4版)学习笔记之12-预处理程序——黑马 IOS 技术博客
- iOS新手学习第一天 学习笔记 iPhone的第一个程序
- 【极客学院】-iOS学习笔记-4-iOS程序打包与发布(模拟器运行,真机运行,发布到App Store)
- IOS学习笔记1—Iphone程序运行流程
- 斯坦福大学公开课 iOS应用开发教程学习笔记(第七课)UIToolbar、iPad 和iPhone的通用程序
- 斯坦福大学iOS应用开发教程学习笔记(第七课)Pad和iPhone的通用程序
- 2011斯坦福大学iOS应用开发教程学习笔记(第七课)Pad和iPhone的通用程序
- ios学习笔记:第一个ios程序