0
我想移動和/解僱我的彈出窗口,如Facebook評論一樣彈出窗口做。我嘗試了自己並搜索,但失敗了。你能幫我這麼做嗎?彈出窗口不動如Facebook評論/像彈出窗口做
我的代碼:
int display_width=context.getResources().getDisplayMetrics().widthPixels;
int display_height=context.getResources().getDisplayMetrics().heightPixels;
final PopupWindow popupWindow=new PopupWindow(viewTmp_comment, display_width, display_height-60,true);
popupWindow.setOutsideTouchable(false);
popupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
popupWindow.showAsDropDown(view);
popupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
popupWindow.setTouchable(true);
popupWindow.showAtLocation(view, Gravity.CENTER,0,0);
popupWindow.setContentView(view);
popupWindow.getContentView().setOnDragListener(new View.OnDragListener() {
@Override
public boolean onDrag(View view, DragEvent dragEvent) {
switch (dragEvent.getAction()) {
case MotionEvent.ACTION_DOWN:
Toast.makeText(context,"Down",Toast.LENGTH_LONG).show();
popupWindow.dismiss();
break;
// case MotionEvent.ACTION_MOVE:
// Toast.makeText(context,"Up",Toast.LENGTH_LONG).show();
//// popupWindow.dismiss();
// break;
}
return false;
}
});
窗口不動了一下 – AAA
你添加動畫到您的對話框看法? –
是的,我加入了一些動畫,但沒有奏效 – AAA