[英]How LinearLayout align in left bottom after Scale?
i have LinearLayout
, i scale LinearLayout
我有
LinearLayout
,我缩放LinearLayout
ll.setScaleX(0.8f);
ll.setScaleY(0.8f);
I want to align left botton after Scale. 我想在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) 我有结果“后规模”(见图)
Try to set the pivot point before scale it: 尝试在缩放之前设置轴心点:
yourLayout.setPivotX(0); // Left
yourLayout.setPivotY(yourLayout.getHeight()); // Bottom
there are second way take one parent Relativelayout to your linearlayout and set align_parentBottom=true and align_parentLeft=true...i hope this will help you. 第二种方法是将一个父亲Relativelayout带到你的linearlayout并设置align_parentBottom = true和align_parentLeft = true ...我希望这会对你有帮助。 i havent try this...
我还没试过......
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.