facebookログインサイトを含むwebviewでダイアログを作りたいと思います。
私はPopupWindowで試してみました - テキストフィールドをクリックしてもキーボードが表示されませんでした。
AlertDialogと同じです。最後に、私は純粋なDialogクラスを使用していましたが、それは「機能しています」ですが、テキストフィールドをクリックすると、全体的なwebviewがちらつき、テキストフィールドのほかに透明に変わります。
私は、スクリーンショットを、警告欄とfacebookログインWebサイトにテキストフィールドの後に付けます。
ハードウェアアクセラレーションや背景を設定してみましたが効果はありませんでした。 facebookのログインポップアップをwebviewに表示する他の方法はありますか?
ありがとうございました! コード:ダイアログ内でFacebookのログインがちらつくWebview
Dialog dialog = new Dialog(MyActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.webview_popup);
dialog.setCanceledOnTouchOutside(true);
dialog.setCancelable(true);
WebView popupWebview = (WebView)dialog.findViewById(R.id.webViewFromPopup);
popupWebview.loadUrl(url);
dialog.show();
XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/popupWindow"
android:background="#000"
android:minHeight="600dp">
<WebView
android:id="@+id/webViewFromPopup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layerType="software"
android:layout_weight="0.8"
android:background="#FFFFFFFF"
/>
</LinearLayout>
SOLUTION:
私はプログラムでダイアログを構築しています - それは問題を解決しています...何とか。
コード:
/* webview popup */
private Dialog webViewPopup;
private void showWebViewPopup(final String url)
{
Dialog dialog = new Dialog(MyActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.webview_popup);
dialog.setCancelable(true);
WebView popupWebview = new WebView(MyActivity.this);
LayoutParams params = new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT, 0.99f);
popupWebview.setLayoutParams(params);
Button cancelButton = new Button(MyActivity.this);
LayoutParams bParams = new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT, 0.01f);
cancelButton.setLayoutParams(bParams);
cancelButton.setText("Cancel");
cancelButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
webViewPopup.dismiss();
}
});
LinearLayout popupLayout = (LinearLayout) dialog.findViewById(R.id.popupWindow);
popupLayout.addView(popupWebview);
popupLayout.addView(cancelButton);
dialog.show();
popupWebview.loadUrl(url);
webViewPopup = dialog;
}
XML:(webview_popup.xmlファイル)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/popupWindow"
android:minHeight="600dp"
>
</LinearLayout>
Facebookのパスワードを取り込む...?私はフェイスブックのサイトにどのように送ってくれるの?それは私が推測する合法ではないことに言及しない – Piotr