showAsDropDown && showAtLocation
来源:互联网 发布:新疆教师网络培训网 编辑:程序博客网 时间:2024/05/18 02:24
public void showPopWindow(View parentView,int pHeight){
System.out.println("#### pHeight = "+pHeight);
LayoutInflater inflater = (LayoutInflater) mActivity
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.pop_editeview_layout, null);
mWindow = new PopupWindow(view, 1000, 40);
mWindow.setFocusable(true);
// mWindow.showAtLocation(parentView, Gravity.CENTER | Gravity.TOP, 0, 10);
mWindow.showAsDropDown(parentView, 0, 0);
//showAtLocation(View parent, int gravity, int x, int y),
// parent:显示此popwindow的父窗口
// gravity: popwindow在父窗口中的重心位置
//showAsDropDown(View anchor, int xoff, int yoff)
//以anchor左下角位置为原点,加上x,y轴的偏移量(遵循右上原点坐标系),修正原点,显示
//popwindow的内容,当popwindow超过右边界时,超过的部分向左边挤。
mWindow.setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss() {
// TODO Auto-generated method stub
}
});
initView(view);
}
System.out.println("#### pHeight = "+pHeight);
LayoutInflater inflater = (LayoutInflater) mActivity
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.pop_editeview_layout, null);
mWindow = new PopupWindow(view, 1000, 40);
mWindow.setFocusable(true);
// mWindow.showAtLocation(parentView, Gravity.CENTER | Gravity.TOP, 0, 10);
mWindow.showAsDropDown(parentView, 0, 0);
//showAtLocation(View parent, int gravity, int x, int y),
// parent:显示此popwindow的父窗口
// gravity: popwindow在父窗口中的重心位置
// x,y : popwindo在重心位置的偏移量,可以先依重心位置确定原点,再加上偏移量
// 好像:传入的parentView无论是什么都会使用Activity的全屏视图。
//showAsDropDown(View anchor, int xoff, int yoff)
//以anchor左下角位置为原点,加上x,y轴的偏移量(遵循右上原点坐标系),修正原点,显示
//popwindow的内容,当popwindow超过右边界时,超过的部分向左边挤。
mWindow.setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss() {
// TODO Auto-generated method stub
}
});
initView(view);
}
0 0
- showAsDropDown && showAtLocation
- PopupWindow显示showAsDropDown和showAtLocation区别
- PopupWindow showAtLocation和showAsDropDown参数分析
- Android下PopupWindow隐藏及显示(showAtLocation/showAsDropDown)
- Android下PopupWindow隐藏及显示(showAtLocation/showAsDropDown)
- Android下PopupWindow隐藏及显示(showAtLocation/showAsDropDown)
- Android开发之PopupWindow的showAtLocation()和showAsDropDown()
- 【Android 非常基础】PopupWindow showAtLocation和showAsDropDown参数分析
- 【Android 非常基础】PopupWindow showAtLocation和showAsDropDown参数分析
- (原创)关于PopupWindow的showAsDropDown()和showAtLocation()使用方式及其区别
- 关于PopupWindow的showAsDropDown()和showAtLocation()使用方式,popupWindow的各种弹出
- PopupWindow.showAtLocation理解
- android7.0-PopupWindow-showAsDropDown
- Android开发PopupWindow showAtLocation用法
- Android开发PopupWindow.showAtLocation用法
- Android开发PopupWindow showAtLocation用法
- Android开发PopupWindow showAtLocation用法
- Android开发PopupWindow.showAtLocation用法
- 【javascript】javascript中的JSON.parse()和JSON.stringify()
- CKEditor和CKFinder在ASP.NET项目中安装,配置和使用详解
- java生成条形码
- QT下的几种透明效果
- 黑马程序员——【Java】IO——流合并、切割
- showAsDropDown && showAtLocation
- emwin,hello world
- PHP5.5新特征以及有可能的版本差异
- 关于jquery中工具函数
- 黑马程序员——【Java】IO——对象序列化
- 织梦实现分类页的优化伪静态
- js select多选框操作
- Asterisk Queue呼叫中心的实现
- 滨州学院CSDN高校俱乐部第八期公开课——产品运营和推广