mardi 12 mai 2015

My layout does not look the same in the emulator - Android

I am creating a layout in an Android xml file. Here is a screenshot of the layout. Layout Screen Shot

Here is the xml for the file:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="55dp"
        android:gravity="center_vertical"
        android:paddingLeft="15dp">

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="John Doe"
            android:id="@+id/reservationName"
            android:layout_weight="2" />

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="24:35"
            android:id="@+id/reservationCount"
            android:layout_weight="1" />

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="12"
            android:id="@+id/reservationTime"
            android:layout_weight="1" />
    </LinearLayout>
</LinearLayout>

But in the emulator, it looks different:

Emulator Screen Shot

Why is the layout different? What am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire