Ma mise en page fonctionne correctement, elle a un parent Linear Layout
et plusieurs à l'intérieur.Mise en page linéaire à l'intérieur de la mise en page du cadre cesse de fonctionner
Maintenant, j'ai besoin d'ajouter une image d'arrière-plan, Alors que j'ai besoin d'ajouter une mise en page ici. Lorsque je change parent Linear Layout
en Frame Layout
, il disparaît tous les éléments dans le linear layout
. Si j'ajoute Frame Layout
, à l'intérieur Linear Layout
il disparaît tous les éléments dans la disposition linéaire.
Je n'arrive pas à comprendre comment mettre une disposition de cadre sans supprimer les éléments de disposition linéaire.
Le code de mise en page est assez long.
Je mets au-dessus une partie de celui-ci.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
>
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:src="@drawable/image11"
/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingTop="10dp"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="7:00 PM CST"
android:layout_gravity="center"
android:gravity="center"
android:textColor="@color/white"
android:fontFamily="sans-serif-medium"
android:textSize="12sp"
/>
</LinearLayout>
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:src="@drawable/icon2"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:orientation="horizontal"
android:paddingLeft="20dp"
android:paddingRight="20dp"
>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:orientation="vertical"
android:background="@drawable/cart_custom_background"
android:paddingBottom="2dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="4"
android:orientation="horizontal"
android:layout_marginRight="1dp"
android:layout_marginLeft="1dp"
>
Essayez la mise en page relative au lieu de la mise en page – Dnyanesh
Merci @Dnyanesh, quand je change 'layout parent'' 'Relative Layout', Tous les éléments disparaissent – Kirmani88
Etes-vous sûr de votre layout_height/layout_width ne sont pas égaux à 0 dp dans le framelayout ? –