设置AlertDialog位置大小(模拟windows右击菜单)
来源:互联网 发布:知乎名字来源 编辑:程序博客网 时间:2024/05/29 18:16
menuDialog = new AlertDialog.Builder(this).create();menuDialog.setView(menuView);menuDialog.show();dlgSetting();menuDialog.show();
private boolean dlgSetting(){ int[] location = new int[2]; WindowManager m = getWindowManager(); Display d = m.getDefaultDisplay(); View view = mGridView.getChildAt(nCurPosition); if(view==null) return false; view.getLocationInWindow(location); WindowManager.LayoutParams lp = menuDialog.getWindow().getAttributes(); lp.x = -(d.getWidth()/2-location[0]-view.getWidth()); //新位置X坐标 lp.y = -(d.getHeight()/2-location[1]-view.getHeight()); //新位置Y坐标 lp.height = 200;//对话框高 lp.width = 150;//对话框宽 menuDialog.getWindow().setAttributes(lp); menuDialog.dismiss(); return true; }
- 设置AlertDialog位置大小(模拟windows右击菜单)
- 设置AlertDialog的大小位置
- 设置AlertDialog的大小位置
- 右击新建菜单设置
- 设置QT鼠标右击菜单
- 设置 AlertDialog窗口的大小
- Android 设置AlertDialog固定大小
- AlertDialog自定义标题大小、颜色、位置
- android AlertDialog Dialog显示位置、大小,背景
- 自定义AlertDialog的位置和大小确定
- 窗口位置、大小设置
- Windows去掉桌面右击菜单多余项
- 设置alertdialog弹出框的弹出位置
- android中设置AlertDialog的大小
- android中设置AlertDialog的大小
- android中设置AlertDialog的大小
- android中设置AlertDialog的大小 .
- android中设置AlertDialog的大小 .
- 立即数方式
- 阻塞与死锁(一)——基础知识
- JS常用基础知识
- 域(转)
- soap security negotiation failed
- 设置AlertDialog位置大小(模拟windows右击菜单)
- VFP全面控制EXCEL(转自十豆三老师)
- 软件架构模式的种类
- 惊醒自己!
- Android JNI调用 - char*与jstring相互转换
- NoSQL 数据建模技术
- 新浪微博的JSON解析
- 2005年百度之星程序设计大赛试题初赛题目-题3
- MyEclipse 安装ibatis插件