• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

새로 LinearLayout을 하고 강의와 같이 ImageView를 작성했는데 사진이 뜨지를 않습니다.

24.03.16 22:05 작성 조회수 82

0

새로 LinearLayout을 하고 강의를 따라서 ImageView를 작성했는데 사진이 뜨지를 않습니다. 어디가 오류인지 잘 모르겠습니다ㅠㅠ

res/drawable 하위에 이미지 파일은 다 넣었습니다.

 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#5D985D"
    tools:context=".MainActivity">
    
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:layout_marginTop="100dp">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:textSize="30sp"
            android:textColor="@color/black"
            android:layout_margin="20dp"
            android:gravity="center"
            android:textStyle="bold"
            android:text="인생은 주사위 한방"/>

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="200dp">
        
        <ImageView
            android:src="@drawable/dice_1"
            android:layout_width="120dp"
            android:layout_height="120dp"/>

        <ImageView
            android:src="@drawable/dice_2"
            android:layout_width="120dp"
            android:layout_height="120dp"/>

    </LinearLayout>
    
</LinearLayout>

답변 1

답변을 작성해보세요.

0

맨 위에

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

을 추가해보시겠어요?

위시리님의 프로필

위시리

질문자

2024.03.16

ImageView에 너무 집착해서 바로 전에 말씀하신 vertical 을 완전 놓치고 있었네요ㅠㅠ 감사합니다!!

파이팅입니다!