Ich habe eine LinearLayout
mit 9 statischen Kindern. Ich möchte 2 Kinder (in der Reihenfolge childAt(0)
und childAt(1)
) als ViewGroup
bekommen, um eine Animation anzuwenden. Ich möchte keine neue LinearLayout
erstellen, weil ich zuerst die Kinder von ihren Eltern entfernen muss und es wird tatsächlich die Kinder entfernen, und ich tue es nicht, da ich diese Kinder nur gemeinsam animieren möchte.Wie erhalten LinearLayouts Kinder als Viewgroup?
Zum Beispiel:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical" >
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/to" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/subject" />
<EditText
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="top"
android:hint="@string/message" />
<Button
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/send" />
</LinearLayout>
Ich mag Kind bekommen 2 und 3 als ViewGroup
.
seit LinearLayout ist bereits eine Viewgroup, gibt es eine Möglichkeit, Kind 2 und 3 als Viewgroup zu bekommen? – cyberlyn06