【发布时间】:2015-04-10 10:11:02
【问题描述】:
将此动画应用到我的(子)RelativeLayout 后,我的背景图像具有良好的尺寸,但我的布局似乎继续在我的页面(父)RelativeLayout 上占据很多位置。有什么想法吗?
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >
<scale
android:fromXScale="1.0"
android:fromYScale="1.0"
android:toXScale="0.2"
android:toYScale="0.2"
android:duration="700"
>
</scale>
</set>
<RelativeLayout ...>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/chieldLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bigImage"
>
<Button
style="@style/boutonBrun"
android:id="@+id/btPanier"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/full22lightgreen"
/>
</RelativeLayout>
</RelativeLayout>
我已经添加了,就像你建议我使用这个命令来适应我的布局:
params.width = (int) getResources().getDimension(R.dimen.size_width);
我怎么知道我必须输入的“size_width”?就像我要求从 1.0 缩放到 0.2 并最终放入 android:layout_width="300dp",我想象“size_width”必须占用 60dp (300 * 0.2) 但与动画后的尺寸相比它非常小。
【问题讨论】:
标签: android scale android-relativelayout