Home > database >  XML tag <space> not accepted in a layout file (Android Studio)
XML tag <space> not accepted in a layout file (Android Studio)

Time:12-20

his is my first entry in StackOverFlow and my first steps with Android-Studio, with a hopefully not too severe problem.

The use of the tag is offered, but after insertion it is marked red as an error. The behaviour occurs regardless of the layout type.

1

I am not clear why this is marked as an error.

I have tried to use other layouts.

My expectation:

The tag is not marked as an error.

CodePudding user response:

Space like any other view in a XML layout has some mandatory attributes you are not providing: android:layout_width and android:layout_height. Omitting these produces the red error underline.

CodePudding user response:

If you hover over the error, you'd notice a popup appearing. In this case, you are missing 2 compulsory attributes (width and height). adding them will remove the error.

enter image description here

  • Related