0
UIAlertController에서 UIButton을 추가하고 있지만 이벤트가 발생하지 않았습니다.iOS - UIAlertController에서 UBIlertController의 UIButton이 이벤트를 발생시키지 않습니다.
UIButton *cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[cancelBtn setFrame:CGRectMake((_alertController.view.frame.size.width/2)-30, _alertController.view.frame.size.height-50, 60, 30)];
[cancelBtn setTitle:@"Cancel" forState:UIControlStateNormal];
[cancelBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
[cancelBtn setBackgroundColor:[UIColor orangeColor]];
[cancelBtn addTarget:self action:@selector(forceFullDismiss_FireDelegate:) forControlEvents:UIControlEventTouchUpInside];
cancelBtn.showsTouchWhenHighlighted = YES;
[_alertController.view setUserInteractionEnabled:YES];
[_alertController.view addSubview:cancelBtn];
버튼이 강조 표시된 것처럼 보이지만 각각의 이벤트가 실행되지 않습니다.
무엇이 문제입니까?
을 사용할 수 있으며 목표에 대한 오류가 없다? breakpoint는'forceFullDismiss_FireDelegate'에서 멈추지 않습니다. –
오류가 없습니다. 예, 브레이크 포인트가 forceFullDismiss_FireDelegate에서 멈추지 않습니다. – Hassy