【发布时间】:2020-07-22 12:40:55
【问题描述】:
您好,我在按钮中添加了一个可绘制对象:
Drawable image = null;
image = getActivity().getDrawable(R.drawable.ic_spinner);
int h = image.getIntrinsicHeight();
int w = image.getIntrinsicWidth();
image.setBounds( 0, 0, w, h );
button.setCompoundDrawables( null, null, image, null);
我想无限旋转它
我在 res/anim/rotate.xml 中创建它
<?xml version="1.0" encoding="utf-8"?>
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="infinite" />
我没有找到调用它并在我的按钮中分配给drawable的解决方案
你有什么想法吗?
感谢您的帮助
【问题讨论】:
-
这能回答你的问题吗? how to rotate an image continuously?
-
已经测试过这篇文章,它旋转按钮,而不是按钮中的drawable
标签: java android android-studio drawable