zoukankan      html  css  js  c++  java
  • [某鸥实训记][objective-c][第三天][个人笔记]

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

    //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];
  • 相关阅读:
    [leetcode]_Search Insert Position
    [leetcode]_Merge Two Sorted Lists
    [leetcode]_Valid Parentheses
    喧闹中坚守底线-徘徊的行走在不知道路在何方的大地上。
    [leetcode]_Longest Common Prefix
    [leetcode]_Remove Nth Node From End of List
    [leetcode]_Roman to Integer
    [leetcode]_Palindrome Number
    策略模式(Strategy)
    面向对象
  • 原文地址:https://www.cnblogs.com/NyaSu/p/4798847.html
Copyright © 2011-2022 走看看