我是一个Android开发的新手,正在尝试找出如何在视图中的特定坐标显示NewQuickAction3D弹出对话框。我正在将弹出与这个教程链接集成。本质上,我想使用弹出对话框来显示用户触摸的数据,而不是在画布上绘制“infoview”。目前,弹出对话框会显示在我锚定到的视图的顶部和中心。如何使它显示特定的坐标?非常感谢您的任何帮助。
我的代码:
我的代码:
public void updateMsg(String t_info, float t_x, float t_y, int t_c){
infoView.updateInfo(t_info, t_x, t_y, t_c); //Infoview paints to on a specific coordinate
quickAction.show(infoView); //How do I use the t_x & t_y coordinates here instead of just anchoring infoview
编辑
public void updateMsg(String t_info, float t_x, float t_y, int t_c){
infoView.updateInfo(t_info, t_x, t_y, t_c);
WindowManager.LayoutParams wmlp = quickAction.getWindow().getAttributes(); //Error here getting window attributes
wmlp.gravity = Gravity.TOP | Gravity.LEFT;
wmlp.x = 100; //x position
wmlp.y = 100; //y position
quickAction.show(infoView);
}