View view = findViewById(R.id.view_id); view.setScaleY(2.0f);
View view = findViewById(R.id.view_id); view.setScaleY(0.5f);This code sets the scaling factor of the Y axis of the view with id `view_id` to 0.5f, which halves its size. Package library: This method is part of the android.view.View class which is part of the Android SDK Platform package.