Search code examples
androidviewscale

How LinearLayout align in left bottom after Scale?


i have LinearLayout, i scale LinearLayout

ll.setScaleX(0.8f);
ll.setScaleY(0.8f);

I want to align left botton after Scale. How i can make this?

When i make:

Display mdisp = getWindowManager().getDefaultDisplay();
Point mdispSize = new Point();
mdisp.getSize(mdispSize);
maxX = mdispSize.x; 
maxY = mdispSize.y;
commonCardContainer.setX(0);
commonCardContainer.setY(maxY - commonCardContainer.getHeight());

I have result "after scale" (see picture)

enter image description here


Solution

  • Try to set the pivot point before scale it:

    yourLayout.setPivotX(0); // Left
    yourLayout.setPivotY(yourLayout.getHeight()); // Bottom