0

I am designing game menu,I am taking reference of http://p-xr.com/android-tutorial-game-menu-with-a-custom-font/comment-page-1/#comment-857

My main.xml file currently contains:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"> 


<ImageView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:src="@drawable/wallpaper1" />

    <LinearLayout
        android:orientation="vertical"
        android:layout_margin="10dp"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <TextView
            android:text="START GAME"
            android:layout_gravity="right"
            android:id="@+id/start"/>

        <TextView
            android:text="QUICK GAME"
            android:id="@+id/quick"/>

        <TextView
            android:text="SETTINGS"
            android:id="@+id/settings"/>

        <TextView
            android:text="ABOUT"
            android:id="@+id/about"/> 

        <TextView
            android:text="EXIT"
            android:id="@+id/exit"/>

    </LinearLayout>
</RelativeLayout>

However there seems to be an error error, which I do not understand, in graphical layout which says: "You must specify layout_height and layout_width".

2
  • Please use proper English. I am a native speaker however what you wrote will more than likely confuse those who do not speak English as their first language. Feb 8, 2012 at 11:46
  • ya..sure..and sorry. evn i am learning it..its not my first language. sorry once again! Feb 8, 2012 at 19:33

1 Answer 1

1

AFAIK, attributes android:layout_width and android:layout_height are mandatory for each view declared in a XML layout file.

Just define them for each TextView element.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.