Can I scale a View in Android?

bjdodson picture bjdodson · Oct 1, 2011 · Viewed 30.8k times · Source

Can I take a view that has been rendered by the Android framework and rescale it to some other size?

Answer

Gadzair picture Gadzair · Nov 14, 2013

You need API 11 or above to scale a view. Here is how:

float scalingFactor = 0.5f; // scale down to half the size
view.setScaleX(scalingFactor);
view.setScaleY(scalingFactor);