我的popupwindow不知道为什么不响应返回事件
我设置了这些:
popupWindow.setFocusable(true);
popupWindow.setTouchable(true);
popupWindow.setOutsideTouchable(true);还有:popupwindow只能用手机顶部弹出来的么?我想从底部弹出来行不行
我设置了这些:
popupWindow.setFocusable(true);
popupWindow.setTouchable(true);
popupWindow.setOutsideTouchable(true);还有:popupwindow只能用手机顶部弹出来的么?我想从底部弹出来行不行
解决方案 »
- android中 如何获取drawable中的png图片 并显示成背景透明效果
- 广告平台
- 如何截取File文件里的内容啊
- 使用mediaRecorder录音被系统自动终止
- 怎么样才能在android中显示公式
- 谁知道系统自带的主题样式文件放在那个目录下呀?
- 应用只有第一次启动时显示欢迎界面,怎么可以设计成每次启动时都显示
- android.os.Process.killProcess(android.os.Process.myPid())与Activity生命周期的影响
- Android 编译ffmpeg
- 不知道有没有来对地方,关于linphone 'Android移植的
- 在自定义控件里 如何销毁使用这个控件的Activity;
- android 在耗时操作里面怎么显示ProgressDialog?
public void onDismiss() {
// TODO Auto-generated method stub
}
});
popUpWindow消失后响应
/**
* <p>
* Display the content view in a popup window at the specified location. If the popup window
* cannot fit on screen, it will be clipped. See {@link android.view.WindowManager.LayoutParams}
* for more information on how gravity and the x and y parameters are related. Specifying
* a gravity of {@link android.view.Gravity#NO_GRAVITY} is similar to specifying
* <code>Gravity.LEFT | Gravity.TOP</code>.
* </p>
*
* @param parent a parent view to get the {@link android.view.View#getWindowToken()} token from
* @param gravity the gravity which controls the placement of the popup window
* @param x the popup's x location offset
* @param y the popup's y location offset
*/
public void showAtLocation(View parent, int gravity, int x, int y) {
showAtLocation(parent.getWindowToken(), gravity, x, y);
}从SDK内摘录的,可以调整popUpWindow的位置
你自己截获back键的事件,如果PopupWindow有show出来,那你就dismiss掉。
2.PopupWindow弹出来的方向,系统有个默认的弹出动画,你可以自己设定一个动画用来替换。
好像方法名叫setAnimationStyle()。