码迷,mamicode.com
首页 > 其他好文 > 详细

[某鸥实训记][objective-c][第三天][个人笔记]

时间:2015-09-10 20:52:31      阅读:105      评论:0      收藏:0      [点我收藏+]

标签:

..还是粘的课上做的笔记

//WebView+Image Animation+Timer
//UIBarButton
    UIBarButtonItem *bar = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemSearch target:self action:@selector(search:)];
    self.navigationItem.rightBarButtonItem = bar;
//    navigationItem中有一些项可以设置为自己定义的控件
//URL
    _webView.frame = self.view.frame;
    NSString *str = [NSString stringWithFormat:@"http://www.baidu.com"];
    NSURL *url = [NSURL URLWithString:str];
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
    [_webView loadRequest:request];
    
//    字符串,变为url,发送请求

//UIImageView播放动画
    _tomImageView = [[UIImageView alloc] init];
    _tomImageView.frame = self.view.frame;
    _tomImageView.image = [UIImage imageNamed:@"1.jpg"];


    NSMutableArray *arr = [[NSMutableArray alloc] initWithCapacity:10];
    for(int i = 0;i<26;i++){
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"cat_angry%04d.jpg",i]];
        [arr addObject:image];
    }
    _tomImageView.animationImages = arr;
    _tomImageView.animationRepeatCount = 1;
    _tomImageView.animationDuration = 2.6;
    [_tomImageView startAnimating];


//Timer
 self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(change) userInfo:nil repeats:YES];

 

[某鸥实训记][objective-c][第三天][个人笔记]

标签:

原文地址:http://www.cnblogs.com/NyaSu/p/4798847.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!