ViewGroup旋转
自己想写一个继承自ViewGroup的类,希望它可以实现旋转的功能,就是当两个手指在屏幕上扭动的时候,屏幕上的内容可以跟着扭转,请问这个具体要怎么实现呢?非常感谢!
[解决办法]
在viewGroup类的dispatchDraw()中对canvas进行变换, 比如canvas.rotateX(), canvas.rotateY()等
dispatchDraw() {
canvas.save();
canvas.rotateX();
super.dispatchDraw()
canvas.restore();
}