Code Monkey home page Code Monkey logo

Comments (4)

OrangeHao avatar OrangeHao commented on August 28, 2024

用到坐标映射的例子都偏了⊙﹏⊙
应该跟机型没关,我用手机试了下也一样

from androidnote.

GcsSloop avatar GcsSloop commented on August 28, 2024

等我修复一下

from androidnote.

GcsSloop avatar GcsSloop commented on August 28, 2024

我知道什么锅了。

请关闭硬件加速试试

等我修复文章说明,不得不说,硬件加速实在是太坑了。(´・_・`)

from androidnote.

happyldc avatar happyldc commented on August 28, 2024

我的小米手机 android7.0 运行RemoteControlMenu 点击时也会有偏移效果, 后来经过修改类里面的onTouchEvent方法,event.getRawX()和event.getRawY() 分别改为event.getX()和event.getY()后解决了偏移问题。
原:

    public boolean onTouchEvent(MotionEvent event) {
        float[] pts = new float[2];
        pts[0] = event.getRawX();
        pts[1] = event.getRawY(); 
         // ...省略N行代码
}

修改后:

    public boolean onTouchEvent(MotionEvent event) {
        float[] pts = new float[2];
        pts[0] = event.getX();
        pts[1] = event.getY(); 
       // ...省略N行代码
}

from androidnote.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.