Here is my xmls (there are basically two views: a linear [B] inside a relative [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> I'm setting the width of B as 10 times of the screen width, namely w*10:
RelativeLayout.LayoutParams para = new RelativeLayout.LayoutParams(w*10, h); B.setLayoutParams(para); When I animate B,
ObjectAnimator animation2 = ObjectAnimator.ofFloat(B, "x", -w) it shows that the width of B is w rather than w*10, as if A, who is being the parent view, is limiting its width.
What should I do to have B's width as w*10?