il y a un code de ma mise en page:Android: Voir sur l'aperçu du design est pas comme le vrai
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="119dp"
android:layout_height="84dp"
android:src="@drawable/image_template"
android:id="@+id/roleIco"
android:scaleType="fitCenter"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="the name of the player"
android:id="@+id/playerName"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:layout_marginTop="16dp"
android:layout_marginLeft="8dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp" />
<TextView
android:text="Role name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/roleName"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:layout_marginTop="16dp" />
<TextView
android:text="Fraction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/fractionName"
android:layout_marginTop="16dp"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
</LinearLayout>
<ImageView
android:layout_width="74dp"
android:layout_height="match_parent"
android:src="@drawable/icon_heart"
android:id="@+id/playerStatusIcon"
android:scaleType="fitCenter" />
</LinearLayout>
Et le problème est que, en avant-première conception dans Android studio, il ressemble à ça: See this image, please
Mais quand je lance cette application sur le téléphone, il ressemble à ceci:
Quelqu'un pourrait aider moi quelle est la raison de cette différence et comment l'éliminer et changer la vue réelle à cela comme sur l'aperçu?
Merci pour la réponse;)
faites-vous référence à la couleur du texte en avant-première? – Sanjeet
Vous n'avez pas défini d'orientation pour la disposition linéaire parent. Essayez de définir son orientation sur 'horizontal'. –
@Vaibhav Agarwal orientation par défaut est toujours horizontale même si vous ne le définissez pas –