Mi permetta di fornire la soluzione rispetto alla 480x854 pixel dello schermo MDPI
Scenario 1: Si desidera RadioB per attraversare LinearLayout con RelativeLayout come ViewGroup padre rispetto a devi correggere il tuo ordine z. Fai le modifiche come sotto il layout. L'animazione inizia dal punto A (0,0) al punto C (300,300) del RelativeLayout.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:background="#ffffff">
</LinearLayout>
<RadioButton
android:id="@+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New RadioButton"
/>
</RelativeLayout>
Scenario 2: Si vuole RadioButton per animare il LinearLayout con LinearLayout come ViewGroup genitore che è necessario impostare il layout, come di seguito. L'animazione inizia dal punto B (20,20) (come per il valore layout_margin
) al punto D (320.320) del RelativeLayout.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:background="#ffffff">
<RadioButton
android:id="@+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New RadioButton"
/>
</LinearLayout>
</RelativeLayout>
Scenario 3: Si vuole RadioButton per animare tutto il LinearLayout con LinearLayout come genitore ViewGroup e la vostra x o il valore y va oltre la dimensione confini LinearLayout in entrambe le direzioni per esempio x = 800> 480 pixel o Y = 1200> 854 pixel
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
<!-- Allow all the children to go out of their parent boundaries -->
android:clipChildren="false"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
<!-- Allow all the children to go out of their parent boundaries -->
android:clipChildren="false"
<!-- Do not clip the children at the padding i.e. allow to children go
beyond the padding -->
android:clipToPadding="false"
android:background="#ffffff">
<RadioButton
android:id="@+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New RadioButton"
/>
</LinearLayout>
</RelativeLayout>
Mi auguro che aiuta ...
Felice di codifica ...
fonte
2015-08-10 19:43:03
Il LinearLayout è sopra la RadioButton. – ElDuderino
Con "in un altro layout" intendi che vuoi che il tuo 'RadioButton' diventi figlio del tuo' LinearLayout'? – tachyonflux
Sì, ma non dimenticare che voglio l'animazione. Quindi, per passare da un layout all'altro – user1851366