Please help me i want to get position of imageview on a layout.
x = imageViewObject.getLeft();
y = imageViewObject.getTop();
Hope, it help you!
You can use this with getLocationOnScreen(int [])
At runtime you can get the location of every View
object (this includes Layouts
too) with
Left Position of View Object getleft()
Top Position of View Object getTop()
Right Position of View Object getRight()
Bottom Position of View Object getBottom()
Even you can get the location with
getLocationOnScreen(int [] )
Position meaning x and y and height and width?
This layout is a view, that view has these properties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With