[英]How LinearLayout align in left bottom after Scale?
我有LinearLayout
,我縮放LinearLayout
ll.setScaleX(0.8f);
ll.setScaleY(0.8f);
我想在Scale之后對齊左邊的按鈕。 我怎么能做到這一點?
當我做:
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());
我有結果“后規模”(見圖)
嘗試在縮放之前設置軸心點:
yourLayout.setPivotX(0); // Left
yourLayout.setPivotY(yourLayout.getHeight()); // Bottom
第二種方法是將一個父親Relativelayout帶到你的linearlayout並設置align_parentBottom = true和align_parentLeft = true ...我希望這會對你有幫助。 我還沒試過......
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.