I am using NineOldAndroids to rotate a button when users click on it. here are the codes:
Button btntest = (Button) findViewById(R.id.testbutton);
btntest.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
ObjectAnimator.ofFloat(v, "rotation", 0f, 360f).start();
}
});
When I clicked on the button, it thrown this log into logcat:
10-24 05:25:42.394: E/PropertyValuesHolder(2387): Couldn't find setter property rotation for Button with value type float
I have took many searching but I didn't find any solution here. Please help me.
Thanks.
Finally, I found my root cause. I am using both
NineOldAndroids
andActionbarSherlock
. And then, becauseActionbarSherlock
already include a part of NineOldAndroids, so I importedcom.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator
instead ofcom.nineoldandroids.animation.ObjectAnimator
.NineOldAndroids
works fine on all android SDK versions.