Henry Lu
Henry Lu

Reputation: 21

In Android, What is the x y origin value of Touch/click on app screen?

When I develop a app, I click at the up-left corner, I got x=0 y=59 or something. How do I determine the y value? There are two rows above my Touchable screen in my app: 1 first line/row is a tool/status bar which I don't know how to access it 2. next line is my app name like "Hello World". I think this two play a role to determine the y value. How do I termine origin y value in my program?

-Henry

Upvotes: 2

Views: 1516

Answers (1)

JQCorreia
JQCorreia

Reputation: 717

Try playing with getRawX() and getRawY() on your MotionEvent(assuming you aren't already)

More details in documentation

Upvotes: 1

Related Questions