Whats up with setScaleX/setScaleY?

I met a similar problem when I tried to set the view with an initial scaleX value before playing any animations, however view.setScaleX() is since API Level 11 accroding to @Dr.J .

If you want to use the Honeycomb Animation API in earlier API Levels, do have a try with NineOldAndroids at http://nineoldandroids.com/ . Based on this opensource lib, there is a workaround to provide the view an initial scaleX.

    ObjectAnimator.ofFloat(getMyButton(), "scaleX", 1f, 0f).setDuration(1).start();

nope, the Docs are right:

public void setScaleX (float scaleX) Since: API Level 11

Froyo is API Level 8.


NineOldAndroid is deprecated according to it's github link NineOldAndroid

Use Android Support library instead of NineOldAndroid

so you should use ViewCompatinstead of ViewHelper

simply change:

view.setScaleX(2);

or

ViewHelper.setScaleX(view,2);

to:

ViewCompat.setScaleX(view,2);

hope it helps


Ok, it looks like this is a false representation in the docs, as it's explained here scaleX/scaleY are properties added to the View class with Honeycomb and therefore unfortunately not available in Froyo.