开发者

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

开发者 https://www.devze.com 2023-02-24 03:47 出处:网络
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

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 val开发者_JS百科ue in my program?

-Henry


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

More details in documentation

0

精彩评论

暂无评论...
验证码 换一张
取 消