0
이상 UIAlertController 뒤에 내가이 UIAlertController ( UIAlertControllerStyleActionSheet)를 제시 할 때 내 UITableView ( UITableViewController 돌며을) 흐리게 할

을 jQuery과 흐리게하려고하지만, 그냥 차단합니다. 시뮬레이터와 장치 모두에서 발생합니다.가있는 UITableViewController

- (void)showAlert { 
    UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; 

    UIVisualEffectView *visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; 
    visualEffectView.frame = CGRectMake(0, self.tableView.contentOffset.y, self.view.frame.size.width, self.view.frame.size.height); 

    [self.view addSubview:visualEffectView]; 

    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Alert Title" message:@"Alert Message" preferredStyle:UIAlertControllerStyleActionSheet]; 

    [alert addAction:[UIAlertAction actionWithTitle:@"Action 1" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 
     // handle choice... 

     [visualEffectView removeFromSuperview]; 
    }]]; 

    [alert addAction:[UIAlertAction actionWithTitle:@"Action 2" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 
     // handle choice... 

     [visualEffectView removeFromSuperview]; 
    }]]; 

    [self presentViewController:alert animated:YES completion:nil]; 
} 

스크린 샷 : 해야지 액션 시트 뒤에 테이블보기에서 텍스트 내용, 예를 들어, 같은 흐리게 게재 될 수는

enter image description here

있다 이 이미지처럼 :

enter image description here

+0

당신은 visualEffectView.frame = self.view.bounds 시도 할 수있다; ? – HMHero

+0

이미 시도했습니다. 차이를 만들지 마십시오 – shim

+0

테스트 한 결과가 나오고 어쨌든 'UIBlurEffect'가 텍스트와 잘 맞지 않는 것으로 보입니다. – shim

답변

-1

내가보기에 노력하고 그것을 잘 작동합니다. 귀하의 코드에 몇 가지 변경 사항이 있습니다.

- (void)showAlert { 
    UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; 

    UIVisualEffectView *visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; 
    visualEffectView.frame = CGRectMake(0, self.view.frame.size.height/2, self.view.frame.size.width, self.view.frame.size.height); 

    //self.vBlur.backgroundColor = [UIColor clearColor]; 
    [self.view addSubview:visualEffectView]; 

    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Alert Title" message:@"Alert Message" preferredStyle:UIAlertControllerStyleActionSheet]; 

    [alert addAction:[UIAlertAction actionWithTitle:@"Action 1" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 
     // handle choice... 

     [visualEffectView removeFromSuperview]; 
    }]]; 

    [alert addAction:[UIAlertAction actionWithTitle:@"Action 2" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 
     // handle choice... 

     [visualEffectView removeFromSuperview]; 
    }]]; 

    [self presentViewController:alert animated:YES completion:nil]; 
} 

screenshot

another screenshot?

+0

스크린 샷이 나에게 잘 보이지 않습니다. – shim

+0

왜? 그것에 무엇이 잘못 되었습니까? 전체 화면으로 전환 하시겠습니까? – jiten

+0

그 표정이 흐릿 해 보입니까? 그것은 액션 시트 뒤에 단색의 어두운 회색 배경입니다. – shim

관련 문제