Pau*_*Jan 24 android android-4.2-jelly-bean
我有以下代码片段,它使用画布的当前转换矩阵转换一组边界.
final RectF bounds = renderer.computeBounds
activeCanvas.getMatrix().mapRect(result, bounds);
return bounds;
Run Code Online (Sandbox Code Playgroud)
但是,使用最新的API级别(16),我会收到警告
The method getMatrix() from the type Canvas is deprecated
哪个都很好,但Canvas.getMatrix()的当前文档没有提到弃用,也没有提供替代方案.作为一种解决方法,我现在只是简单地抑制了这个警告,但我真的想知道这种新的和改进的(tm)方式是什么样的.
Matrix现在由视图而不是Canvas处理.遗憾的是,我无法解释谷歌对此问题的决定,但你应该能够通过2种方式重现完全相同的事情.
| 归档时间: |
|
| 查看次数: |
7607 次 |
| 最近记录: |