文章标题

来源:互联网 发布:dns设置软件 编辑:程序博客网 时间:2024/06/10 05:36
  • (void)dealloc {
    [_window release];
    [super dealloc];
    }

  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
    // Override point for customization after application launch.
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    UIViewController *VC = [[UIViewController alloc] init];
    self.window.rootViewController = VC;
    [VC release];
    [self.window release];
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.window.frame.size.width / 3, self.window.frame.size.height / 5, self.window.frame.size.width / 3, self.window.frame.size.height / 5)];
    [self.window addSubview:imageView];
    NSMutableArray *mutableArray = [[NSMutableArray alloc] initWithCapacity:0];
    for (int i = 1; i < 9; i ++) {
    // 图片名字
    NSString *name = [NSString stringWithFormat:@”zhu-%d(被拖移).tiff”, i];
    imageView.image = [UIImage imageNamed:name];
    [mutableArray addObject:imageView.image];
    }
    // 动画数组
    [imageView setAnimationImages:mutableArray];
    // 每个图片间隔时间
    [imageView setAnimationDuration:0.1];
    // 循环次数
    [imageView setAnimationRepeatCount:100];
    // 开始动画(可以放在点击事件中)
    [imageView startAnimating];
    [imageView release];
    return YES;
    }

0 0