简体   繁体   English

如何在android中获得图像视图的底部中心x,y?

[英]How can i get the bottom center x,y of my image view in android?

I have tried this code,我试过这段代码,

float blackCenterX = blackX +black.getWidth() / 2;

but what formula should I use if I am looking for the bottom center coordinates of the image?但是如果我正在寻找图像的底部中心坐标,我应该使用什么公式?

Here's how to get the Center|Bottom position of a View:以下是获取视图的中心|底部位置的方法:

+-------+
| View  |
+---X---+
    |
    |___ (X = view.width / 2, Y = view.height)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM