弹出不在设备中工作的视图

时间:2014-02-17 11:18:32

标签: ios iphone ios7 uiviewanimation

我通过放大缩小效果显示弹出视图。当我的应用程序将在登录后从safari返回我正在显示该视图。这在模拟器中工作正常。但它不适用于设备。我在ipad检查那件事。这是我的代码:

    [MyAppDelegate openSessionWithAllowLoginUI:YES completionBlock:^(BOOL result) {
    NSLog(@"Connecte via Joint Page Thank you");
    if (result) {
        NSLog(@"%@  %d ", [[NSUserDefaults standardUserDefaults] dictionaryRepresentation],[[[NSUserDefaults standardUserDefaults] valueForKey:@"isSender"]boolValue]);
        if([[[NSUserDefaults standardUserDefaults] valueForKey:@"isSender"]boolValue]==0 && [[[NSUserDefaults standardUserDefaults] valueForKey:@"isServiceProvider"] boolValue]==0){
            lbl_register.font=[UIFont fontWithName:GZFont size:16];
            lbl_serviceProvider.font=[UIFont fontWithName:GZFont size:14];
            lbl_customer.font=[UIFont fontWithName:GZFont size:14];
        SelectionView.center=self.view.center;
            SelectionView.layer.borderColor=[[UIColor blackColor] CGColor];
            SelectionView.layer.borderWidth=1.0;
            SelectionView.layer.cornerRadius=5;
            SelectionView.layer.masksToBounds=YES;

            [UIView animateWithDuration:0.4 animations:^{
                SelectionView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.1, 1.1);
            } completion:^(BOOL finished) {
                NSLog(@"popped");
                SelectionView.center=self.view.center;

                [UIView animateWithDuration:0.4 animations:^{
                    SelectionView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.95,0.95);
                } completion:^(BOOL finished) {
                   // self.view.userInteractionEnabled=NO;
                }];
            }];
            [self.view addSubview:SelectionView];

1 个答案:

答案 0 :(得分:5)

您尝试此代码

  explodedBackgroundView = [[UIView alloc] initWithFrame:self.view.bounds];


            explodedView = [[UIView alloc]init];
            explodedView.frame = CGRectMake(10, 10, 540, 120);


                     [explodedBackgroundView setFrame:self.view.bounds];
                        explodedView.center=CGPointMake(self.view.center.x, self.view.center.y);




            [explodedBackgroundView setBackgroundColor: [UIColor blackColor]];
            [explodedBackgroundView setAlpha: 0.5];
            [self.view addSubview:explodedBackgroundView];
            explodedView.layer.cornerRadius=20;
            explodedView.transform = CGAffineTransformMakeScale(0.1, 0.1);
            UIImageView *imageView=[[UIImageView alloc]initWithFrame:explodedView.bounds ];
            [explodedView addSubview:imageView]




            [self.view addSubview:explodedView];



            explodedView.transform = CGAffineTransformMakeScale(0.1, 0.1);
            [UIView animateWithDuration:0.2 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
                explodedView.transform = CGAffineTransformIdentity;
                            } completion:^(BOOL finished){
                        // do something once the animation finishes, put it here
                            }];