【每天积累一点点】将PopupWindow显示在指定位置
来源:互联网 发布:有关修车的软件 编辑:程序博客网 时间:2024/05/17 21:31
//以想在控件tvMl的右下角显示PopupWindow为例(popupWindow的右上角在tvMl的右下角) View popPhotoView = LayoutInflater.from(this).inflate(R.layout.popup_ml_choose, null); mlWindow = new PopupWindow(popPhotoView, Utils.dip2px(this, 132), Utils.dip2px(this, 176), true); mlWindow.setBackgroundDrawable(new BitmapDrawable()); mlWindow.setAnimationStyle(R.style.mypopwindow_anim_style); mlWindow.setOutsideTouchable(true); //获取tvMl在屏幕中的位置,其中location[0]是tvMl左上角的x位置,location[1]是tvMl左上角y轴的位置 int[] location = new int[2]; tvMl.getLocationOnScreen(location);// showAtLocation(View parent, int gravity, int x, int y),其中x,y参数是PopupWindow的左上角的(x,y)坐标 mlWindow.showAtLocation(tvMl, Gravity.NO_GRAVITY, location[0] + tvMl.getWidth() - mlWindow.getWidth(), location[1] + tvMl.getHeight());
阅读全文
0 0
- 【每天积累一点点】将PopupWindow显示在指定位置
- Android中PopupWindow显示在指定位置
- popupWindow 在指定位置上的显示
- Android中PopupWindow显示在指定位置
- popupWindow 在指定位置上的显示
- popupwindow 显示在指定的位置
- popupWindow 在指定位置上的显示
- popupWindow 在指定位置上的显示
- popupWindow 在指定位置上的显示
- popupWindow显示在指定位置上的显示
- android 之popupWindow 在指定位置上的显示
- android 之popupWindow 在指定位置上的显示
- android 之popupWindow 在指定位置上的显示
- android 之popupWindow 在指定位置上的显示 .
- android 之popupWindow 在指定位置上的显示
- android 之popupWindow 在指定位置上的显示
- android 之popupWindow 在指定位置上的显示
- android 之popupWindow 在指定位置上的显示
- Mybatis中SQL性能优化注意事项
- fabirc1.0商业正式版本源码解析10——文档翻译之Architecture
- SD卡写入linux镜像后存储变小
- Windows安装Composer出现Composer Security Warning警告的解决方法
- iOS真机crash Log 解析
- 【每天积累一点点】将PopupWindow显示在指定位置
- 安卓开发观察者模式应用-一个service通知多个activity更新ui的实现
- 【学习笔记】微信小程序页面路由
- Android图片加载框架最全解析(二),从源码的角度理解Glide的执行流程
- JobScheduler 详解二
- http1.1与http2.0
- 《Android开发中的颜色代码表》
- 文章标题
- 1016. 部分A+B (15)用时22min