I created a frame animation in a drawable file:

 <?xml version="1.0" encoding="utf-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:drawable="@drawable/photo_circle_anim_1" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_2" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_3" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_4" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_5" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_6" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_7" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_8" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_9" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_10" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_11" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_12" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_13" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_14" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_15" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_16" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_17" android:duration="300"/> </animation-list> 

After installing this resource file as a button background - the images are stretched by the button, the result is not a circle, but a low-quality oval ..) How to make frame-by-frame animation located only in a small part of the button (for example, 50x50dp) Standard android design of the button?

  • @metalurgus, but what will change? The image also stretches. - user189127
  • Have you tried? - Vladyslav Matviienko
  • @metalurgus,: o It worked! Add to the answer :). But now how to install the text .... - user189127

1 answer 1

ImageButton , set the animation in android:src . So will not stretch.
There is no such class to use both the picture and the text in the Android SDK . No.

Nobody forbids ImageButton to put a TextView on top of the ImageButton , in which you enter the text

  • I always thought that applying widgets is a crutch ... - user189127
  • The main problem with this method is that ImageButton installs animation, but how to start it ..... - user189127