Get X, Y Position of Layout

Get X, Y Position of Layout


Detect the position of layout by following the steps.

Step 1:
Create two number variables, I'll name it x and y

Step 2:
Put this code:
float x = Math.round(textview1.getX());
float y = Math.round(textview1.getY());

If you want to set the X, Y position of Layout follow this additional step.

Step 3:
textview1.setX((float)200));
textview1.setY((float)50));

Comments

  1. Good Can u create how to get country info?

    ReplyDelete

Post a Comment

Popular posts from this blog

Number with Comma (9,999)

Get Percent of the Number (98%)