zoukankan      html  css  js  c++  java
  • android PopupWindow显示位置

    PopupWindow的显示及位置设置
     window.showAtLocation(parent, Gravity.RIGHT | Gravity.BOTTOM, 10,10); 第一个参数指定PopupWindow的锚点view,即依附在哪个view上。
    第二个参数指定起始点为parent的右下角,第三个参数设置以parent的右下角为原点,向左、上各偏移10像素。 //将PopupWindow作为anchor的下拉窗口显示。即在anchor的左下角显示

    在控件的其他方向上显示只需修改最后一行代码:

    下方:popupWindow.showAsDropDown(v);

    左边:

    popupWindow.showAtLocation(v, Gravity.NO_GRAVITY, location[0]-popupWindow.getWidth(), location[1]);  

    右边:

    popupWindow.showAtLocation(v, Gravity.NO_GRAVITY, location[0]+v.getWidth(), location[1]);  
  • 相关阅读:
    SVM的新理解
    特征提取,特征选择
    条件随机场
    分类、检测、识别
    matlab fgetl()
    matlab fopen()
    rar ubuntu
    makefile for opencv
    [洛谷P1231] 教辅的组成
    [洛谷P1514]引水入城
  • 原文地址:https://www.cnblogs.com/zhujiabin/p/4759760.html
Copyright © 2011-2022 走看看