gpt4 book ai didi

ios - 弹出 View 在设备中不起作用

转载 作者:行者123 更新时间:2023-11-28 18:34:28 24 4
gpt4 key购买 nike

我正在显示通过放大缩小效果弹出的 View 。当我的应用程序在使用 facebook 登录后从 safari 返回时,我正在显示该 View 。这在模拟器中工作正常。但它不适用于设备。我正在检查 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];

最佳答案

你试试这段代码

  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
}];

关于ios - 弹出 View 在设备中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21827636/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com