[A gull's training note] [Objective-c] [Third Day] [Personal notes]

Source: Internet
Author: User



.. Or a sticky class note.


// WebView + Image Animation + Timer
// UIBarButton
    UIBarButtonItem * bar = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemSearch target: self action: @selector (search :)];
    self.navigationItem.rightBarButtonItem = bar;
// some items in navigationItem can be set as self-defined controls
// 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];
    
// string, become url, send request

// UIImageView plays animation
    _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]; 





[A gull's training note] [Objective-c] [Third Day] [Personal notes]


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.