比如我想把dialog 设置在 屏幕的 200,150,这个点上,怎么设置?
解决方案 »
- android 如何添加USSD测试代码?
- android progressDialog 不动
- 比如我想调用自己已经安装好了的apk软件?
- OS1.5与1.6下,切换UI(setContentView)的表现为何不同?
- send会阻塞比较长的时间?
- 如何获取已经下载过的APK
- 安卓客户端和服务器交互问题
- NDK编译时,报错error: undefined reference to 'rand',是不是安卓库函数里面没有这个函数的实现呢?
- WCF返回JSON绑定Listview出错
- 打包代码混淆问题
- 急求解决android调用闪关灯问题。。各位大虾,跪求指教。程序没报错,但是手机上就是不亮。。
- Android FMRadio 自动搜台问题
WindowManager.LayoutParams lp =w.getAttributes();
//显示位置
lp.x=200;
lp.y=150;
try{
Window win = dlg.getWindow();
WindowManager.LayoutParams wl = win.getAttributes();
if(right){
wl.gravity = android.view.Gravity.RIGHT | android.view.Gravity.TOP;
}else{
wl.gravity = android.view.Gravity.LEFT | android.view.Gravity.TOP;
}
wl.x = xpos;
wl.y = ypos;
wl.height = 500;
wl.flags = WindowManager.LayoutParams.FLAG_DIM_BEHIND
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS ;
wl.alpha = 1.0f;
wl.dimAmount = 0.0f;
win.setAttributes(wl);
}
catch(Exception e){
Log.e(TAG, "setWinAttributes", e);
}
}