2
View
の形状の変形アニメーションを作成したいと思います。たとえば、rectangle
をoval
に変更します。 Androidシェイプ変換ビュー
ColorDrawable[] color = {new ColorDrawable(Color.RED), new ColorDrawable(Color.BLUE), new ColorDrawable(Color.RED)};
TransitionDrawable drawable = new TransitionDrawable(color);
drawable.startTransition(1000);
image.setBackground(drawable);
しかし、私は
ShapeDrawable[]
でそれを行うことを試みたとき、私はノーシェーピング変換をできましたが、
imageView
は黒になった:私は、色のアニメーションと同じ方法でこれを実行しようとしました。
float[] outerR = new float[] {4, 4, 4, 4, 4, 4, 4, 4};
ShapeDrawable oval = new ShapeDrawable(new OvalShape());
ShapeDrawable rect = new ShapeDrawable(new RoundRectShape(outerR, null, null));
rect.setBounds(0,0,120,120);
oval.setBounds(0,0,120,120);
ShapeDrawable [] draws = {rect, oval};
TransitionDrawable drawable = new TransitionDrawable(draws);
drawable.startTransition(1000);
image.setBackground(drawable);
だから、(変更の形状)スムーズView
を変換するためのAndroidのあらゆるprogrammatical方法はありますか?