Friday, 6 September 2013

XML Graphical Layout output does not match with Emulator output in android

XML Graphical Layout output does not match with Emulator output in android

In the layout view my xml looks like this
http://i.imgur.com/SrjWlWo.png
But when I run my program, it looks like this
http://i.imgur.com/UPyy1Gk.png
Why is this happening?
This is the layout file code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
android:orientation="vertical"
android:paddingTop="@dimen/activity_vertical_margin" >
<LinearLayout
android:layout_width="wrap_content"
android:paddingTop="50dp"
android:layout_marginLeft="70dp"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/quiz" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginLeft="25dp"
android:layout_height="wrap_content"
android:src="@drawable/quiztitle" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_marginTop="40dp"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/quiz1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="20dp"
android:adjustViewBounds="true"
android:src="@drawable/quiz1" />
<ImageButton
android:id="@+id/quiz2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:adjustViewBounds="true"
android:src="@drawable/quiz2" />
<ImageButton
android:id="@+id/quiz3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:src="@drawable/quiz3" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation ="horizontal"
android:layout_marginTop="30dp">
<ImageButton
android:id="@+id/quiz4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="60dp"
android:adjustViewBounds="true"
android:src="@drawable/quiz4" />
<ImageButton
android:id="@+id/quiz5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:adjustViewBounds="true"
android:src="@drawable/quiz5" />
</LinearLayout>
<ImageButton
android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:adjustViewBounds="true"
android:src="@drawable/next" />
</LinearLayout>
Thank you to anyone that could help

No comments:

Post a Comment