Comments (4)
用到坐标映射的例子都偏了⊙﹏⊙
应该跟机型没关,我用手机试了下也一样
from androidnote.
等我修复一下
from androidnote.
我知道什么锅了。
请关闭硬件加速试试
等我修复文章说明,不得不说,硬件加速实在是太坑了。(´・_・`)
from androidnote.
我的小米手机 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)
- RemoteControl
- 请教一下, 为什么对View宽高修改了不要调用super.onMeasure HOT 2
- 关于 Canvas mCanvas = new Canvas(bitmap) ,用缓存画布,画线锯齿的问题 HOT 3
- 模糊与滤镜的先后顺序
- 安卓
- 学习git
- 贝塞尔曲线案例之绘制一个弹性的圆
- 第9篇 Matrix_Basic 中有一个错误
- 第10篇 Matrix_Method 中的折叠布局有bug
- 【招聘】Android工程师招聘!!!
- 博客有几篇打不开了
- "确定View大小(onSizeChanged)" 这一节存在误导
- Canvas之绘制基本形状
- 章节缺失:安卓自定义View进阶
- 安卓
- 安卓自定义View进阶-Canvas之绘制图形 部分有误
- 请教一下measure.getLength ()测量长度不包含path.moveto()后再lineTo的线段长度 HOT 1
- Android系统色彩模式RGB_565的问题
- camera 神奇 数值 72 HOT 1
- 大哥,网站上的效果图咋都没了呢,前几天还有。自定义view写的很好,对新手挺友好的的,膜 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from androidnote.