这是我的xmls(基本上有两个视图:B相对[]内的线性[ A])
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/A"
android:layout_width= "wrap_content"
android:layout_height= "wrap_content" >
<LinearLayout
android:id="@+id/B"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
</LinearLayout>
</<RelativeLayout>
我将宽度设置B为屏幕宽度的 10 倍,即w*10:
RelativeLayout.LayoutParams para = new RelativeLayout.LayoutParams(w*10, h);
B.setLayoutParams(para);
当我制作动画B时,
ObjectAnimator animation2 = ObjectAnimator.ofFloat(B, "x", -w)
它表明 的宽度B而w不是w*10,好像作为A父视图的 正在限制其宽度。
我应该怎么做才能拥有B's 宽度w*10?