• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

에러 나옵니다ㅠㅠ

22.09.03 13:36 작성 조회수 277

0

안녕하세요 말씀해주신대로

<LinearLayout>

이미지뷰 3개

</LinearLayout>

<LinearLayout>

이미지뷰 3개

</LinearLayout>

이렇게 입력했는데 문제가 발생합니다.

problems에서 빨간색으로

Top level element is not completed 이렇게 나옵니다.
코드는 아래와 같습니다.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    android:orientation="vertical"
    >

<LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

    <ImageView
        android:src="@drawable/bts_1"
        android:layout_height="100dp"
        android:layout_width="100dp"/>

    <ImageView
        android:src="@drawable/bts_2"
        android:layout_height="100dp"
        android:layout_width="100dp"/>

    <ImageView
        android:src="@drawable/bts_3"
        android:layout_height="100dp"
        android:layout_width="100dp"/>
</LinearLayout>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height=""/>

    <ImageView
    android:src="@drawable/bts_1"
    android:layout_height="100dp"
    android:layout_width="100dp"/>

    <ImageView
    android:src="@drawable/bts_2"
    android:layout_height="100dp"
    android:layout_width="100dp"/>

    <ImageView
    android:src="@drawable/bts_3"
    android:layout_height="100dp"
    android:layout_width="100dp"/>
</LinearLayout>

</LinearLayout>

 

답변 1

답변을 작성해보세요.

0

뭔가 잘못된 것 같은데... 제가 새롭게 작성했습니다.

 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <ImageView
            android:src="@drawable/bts_1"
            android:layout_height="100dp"
            android:layout_width="100dp"/>

        <ImageView
            android:src="@drawable/bts_2"
            android:layout_height="100dp"
            android:layout_width="100dp"/>

        <ImageView
            android:src="@drawable/bts_3"
            android:layout_height="100dp"
            android:layout_width="100dp"/>

    </LinearLayout>


    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <ImageView
            android:src="@drawable/bts_1"
            android:layout_height="100dp"
            android:layout_width="100dp"/>

        <ImageView
            android:src="@drawable/bts_2"
            android:layout_height="100dp"
            android:layout_width="100dp"/>

        <ImageView
            android:src="@drawable/bts_3"
            android:layout_height="100dp"
            android:layout_width="100dp"/>

    </LinearLayout>

    

</LinearLayout>
김킥님의 프로필

김킥

질문자

2022.09.04

아 해결했습니다. 감사합니다. 제가 업로드한 코드에는

<LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

이렇게 끝에 "/>"을 입력했었는데 잘못된 거였네요ㅠㅠ 감사합니다!!