0
私はjavascriptのアラートまたはが ダイアログポップを確認したときにUIAlertViewのタイトルを変更したい
- (void)webView:(UIWebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(id)frame {
NSLog(@"javascript alert : %@",message);
UIAlertView* customAlert = [[UIAlertView alloc] initWithTitle:@"test" message:message delegate:nil cancelButtonTitle:@"확인" otherButtonTitles:nil];
[customAlert show];
}
- (BOOL)webView:(UIWebView*)sender runJavaScriptConfirmPanelWithMessage:(nonnull NSString *)message initiatedByFrame:(nonnull WKFrameInfo *)frame completionHandler:(nonnull void (^)(BOOL))completionHandler{
UIAlertView* customAlert = [[UIAlertView alloc] initWithTitle:@"test" message:message delegate:nil cancelButtonTitle:@"확인" otherButtonTitles:@"취소", nil];
[customAlert show];
return true;
}
のために、警告のために働きます。カスタムUIAlertViewのタイトルだけではないconfimダイアログ
のjavascriptのアラート行うことになってダイアログがカスタムタイトルを示していないこと
、正常に動作しますが、使用時javascriptの確認ダイアログようです。
あなたはどんなアイデアを提案できますか?任意のヘルプは非常に高く評価されます。
UIAlertViewは、あなたが代わりにUIAlertController使用する必要があるのiOS 8で廃止されました。 –