我希望在我的应用程序中复制以下内容:
非常感谢任何有经验的人提供帮助。提前致谢。
正如您所见,它基本上是一个按钮,可以增加/减少其中包含的文本视图的值。该按钮将具有三个视觉状态 -> 未按下,减小和增大(如上图所示,用户点击增加箭头,按钮在该侧看起来被按下)
目前这里有我设计的3种按钮状态:
如您所见,我遇到的问题是能否正确地倾斜/旋转文本视图,以便在增加或减少按钮时它看起来视觉上正确并呈现倾斜状态。
到目前为止,我尝试了两种不同的方法:
Create a custom text view class which overrides the
onDraw()
method to skew the canvas:@Override public void onDraw(Canvas canvas) { canvas.save(); canvas.skew(0.2f, 0f); super.onDraw(canvas); canvas.restore(); }
Integrate the
Rotate3dAnimation
class (source here) and used many different variations to get the desired result such as:Rotate3dAnimation skew = new Rotate3dAnimation( 30, 0, centerX, centerY, 0, false); txtAmount.startAnimation(skew);
非常感谢任何有经验的人提供帮助。提前致谢。