【发布时间】:2012-10-01 08:28:12
【问题描述】:
我有一个从右到左动画的片段。我想将其设置为距离屏幕左侧 100 个单位。这就是我到目前为止所做的。
RelativeLayout tempLi;
Display display = MyActivity.context.getWindowManager().getDefaultDisplay();
final int width = display.getWidth();
tempLi.setLayoutParams(new LayoutParams(width-100, LayoutParams.FILL_PARENT));
这行代码使布局距离右侧少了 100 个单位。我试着做 -width + 100 ,它没有用。
任何建议将不胜感激。 TIA
【问题讨论】:
-
您是否尝试过为布局分配左边距?
标签: android animation layout fragment