Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Element LinearLayout doesn't have required attribute layout_height

Each TextView and Button as well as the LinearLayout tag complain

'layout_height' attribute should be defined

'layout_width' attribute should be defined 

This is my activity_main.xml:

<LinearLayout
xmlns:android="http://schemas.android.com/apk/rest/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:text="@string/main_title" />
<Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/continue_label" />
<Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/new_game_label" />
<Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/about_label" />
<Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/exit_label" />
</LinearLayout>

I'm running Android Studio 1.1.0

like image 218
thecodingmate Avatar asked Dec 04 '25 14:12

thecodingmate


1 Answers

Change your xmlns attribute to be:

xmlns:android="http://schemas.android.com/apk/res/android"

/res/ not /rest/

like image 161
Ken Wolf Avatar answered Dec 07 '25 04:12

Ken Wolf