あなたはNative WebView Rendererを作成することができます。 は、このWebViewのレンダラにWebViewClientを追加します。
webView.SetWebViewClient(new MyWebViewClient());
オーバーライドOnReceivedHttpAuthRequestで次のようにMyWebViewClient
を作成します。ダイアログがユーザー名、パスワードを含むアンドロイドプロジェクトにレイアウトされ
class MyWebViewClient : WebViewClient
{
public override void OnReceivedHttpAuthRequest(Android.Webkit.WebView view, HttpAuthHandler handler, string host, string realm)
{
Dialog dialog = new Dialog(view.Context);
dialog.SetContentView(/*Layout here*/);
dialog.Show();
//On submit Button Click from Layout set username and password:
handler.Proceed(userName, password);
}
}
、フィールドを提出し、キャンセル。これは自分で作成したり、some pagesから助けを得ることができます。
資格情報がわからないのですが、webViewでdiaologboxを開きたいのですが、 – Pritish
できないと思います。ウェブサイトから401の応答を検出し、ユーザからの詳細を取得し、 'SetHttpAuthUsernamePassword'メソッドに戻してページを更新する独自のダイアログを表示することができます。 – tallpaul
にはこれに対応するコードスニペットがあります – Pritish