forked from shichangone/SCGifExample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSCGifExampleViewController.m
48 lines (38 loc) · 1.25 KB
/
SCGifExampleViewController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// SCGifExampleViewController.m
// SCGifExample
//
// Created by on 11-12-7.
// Copyright 2011年 __MyCompanyName__. All rights reserved.
//
#import "SCGifExampleViewController.h"
#import "SCGIFImageView.h"
@implementation SCGifExampleViewController
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
NSString* filePath = [[NSBundle mainBundle] pathForResource:@"1.gif" ofType:nil];
SCGIFImageView* gifImageView = [[[SCGIFImageView alloc] initWithGIFFile:filePath] autorelease];
gifImageView.frame = CGRectMake(0, 0, gifImageView.image.size.width, gifImageView.image.size.height);
gifImageView.center = self.view.center;
[self.view addSubview:gifImageView];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end