J'ai une mise en page avec quelques ImageView comme ceci: Comment mettre en coin arrondi sur ImageView tout en utilisant l'animation sur elle
Comme mentionné dans le coin imageView n'est pas reste arrondi lorsqu'il est utilisé l'animation sur elle. Comment le faire arrondir tout en utilisant l'animation dessus?
Code Mise en page:
<TableLayout
android:layout_width="wrap_content"
android:id="@+id/table1"
android:gravity="center"
android:layout_height="wrap_content">
<TableRow>
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:id="@+id/img1_1"
android:background="@drawable/button"
android:layout_margin="3dp"
/>
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:id="@+id/img1_2"
android:background="@drawable/button"
android:layout_margin="3dp"
/>
</TableRow>
<TableRow>
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:id="@+id/img1_3"
android:background="@drawable/button"
android:layout_margin="3dp"
/>
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:id="@+id/img1_4"
android:background="@drawable/button"
android:layout_margin="3dp"
/>
</TableRow>
</TableLayout>
code Java:
ObjectAnimator animator = ObjectAnimator.ofInt(findViewById(id), "backgroundColor", Color.RED, Color.parseColor("#4caf41")).setDuration(5000);
Toast.makeText(Game.this, "index" + findViewById(id), Toast.LENGTH_LONG).show();
animator.setEvaluator(new ArgbEvaluator());
animator.start();
Essayez d'utiliser Fresco lib ImageView. ça aidera beaucoup! https://github.com/facebook/fresco –