android 如何让PopupWindow显示在ImageView的下方

我有一个popwindow是另外用一个XML来布局的(名字是popwindow.xml)

        tPopupWindow=new PopupWindow(tContext);
                tTempLayout=(LayoutInflater) tContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                tPopupWinView = tTempLayout.inflate(R.layout.popwindow, null);

                tPopupWindow.setWidth(tShowRect.width());
                tPopupWindow.setHeight(tShowRect.height());
                tPopupWindow.setBackgroundDrawable(new BitmapDrawable());
                tPopupWindow.setContentView(tPopupWinView);
                tPopupWindow.setFocusable(false);

另外我的main.xml里面有一个ImageView
现在是我先显示了PopupWindow,然后显示ImageView的时候(之前是GONE的状态,这里显示是置为VISIBLE)
ImageView显示在PopupWindow的下方(基本等于被覆盖在popwindow下面)因为我的PopupWindow是半透明所以看得到比较模糊的图(如果PopupWindow是完全不透明的话是完全看不到我显示的ImageView的)
所以要怎么样让PopupWindow显示在ImageView的下方

那么有什么方法可以让popupwindow在main布局的下层吗

那办不到,popupwindow在你main布局的上层,imageview怎么也到不了popupwindow的上层。
是不是你的设计思路存在问题,一般也不会弹出后要显示下层的内容。

你可以在创建popWindow的时候使用new PopupWindow(view, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
view就是你要点击的ImageView,这样,poopWindow就会在ImageView的下方显示

new PopupWindow(view, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);中的View必须是我代码中的tPopupWinView

popupwindow不是有锚点view的吗,设置anchor的view为你的image,再设置一个偏移量就可以了。

获取到ImageView的坐标,然后你根据它的坐标,来设置你PopupWindow的位置就可以了.setLocation

popupwindow在你main布局的上层,imageview怎么也到不了popupwindow的上层。

谢谢大家,只有作出一点牺牲,曲线救国了 这个问题确实没办法