私は自分のAndroidプロジェクトにを配置EditText
します。PopupWindow
falseに設定PopupWindow.setFocusable
すると、ソフトキーボードは表示されません。そしてPopupWindow.setFocusable
、trueに設定すると、EditText
焦点が絞られ、アクティビティがスリープ状態になります。ポップアップウィンドウの他の項目は機能しますが、電話の戻るボタンとポップアップの外側をクリックしても閉じません。前もって感謝します。
3696 次
2 に答える
10
私のプロジェクトからのいくつかのコードが役立つかもしれません
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
PopupWindow share_popup = new PopupWindow(inflater.inflate(R.layout.share_dropdown, null, false), 162, LinearLayout.LayoutParams.WRAP_CONTENT, true);
share_popup.setOutsideTouchable(true);
share_popup.setTouchable(true);
share_popup.setFocusable(true);
Drawable image_saved = getResources().getDrawable(R.drawable.dummy_bg);
share_popup.setBackgroundDrawable(image_saved);
ここで、これR.drawable.dummy_bg
は透明な画像です。
于 2012-12-16T06:41:22.637 に答える
2
のセットsetBackgroundDrawable
ですPopupWindow
。すべてが大丈夫のようです!びっくりしました!!
于 2012-12-17T07:07:55.327 に答える