마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

xml 문제 아시는 분~

0 추천

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="8dp"
    android:paddingRight="8dp"
    android:orientation="vertical">

    <ImageView
        android:id="@+id/albummart"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
            <TextView
                android:id="@+id/title"
                android:layout_height="match_parent" android:layout_width="match_parent"
                android:textstyle="bold"android:textcolor="#00ccff" android:padding="5dp">
            <TextView
                android:id="@+id/singer"
                android:layout_height="match_parent" android:layout_width="match_parent"
                 android:padding="5dp" textsize="12sp"></TextView></TextView>
</ImageView></RelativeLayout>

 

여기에서

Exception raised during rendering:android.widget.ImageView  can not ve cast to android.view.ViewGroup

이라는 오류가 뜨는데 어떤 부분이 잘못된건가요?ㅜㅜ

월희 (270 포인트) 님이 2015년 11월 20일 질문

1개의 답변

0 추천
 
채택된 답변
ImageView는 ViewGroup이 아니라고 에러에서 친절하게 설명하고있네요,

ViewGroup에는 대표적으로 LinearLayout, RelativeLayout, FrameLayout, TableLayout가 있습니다.

ViewGroup이 아닌 View인 ImageView는 하위에 다른 View를 추가 할 수 없습니다.

TextView를 지우던가 밖으로 이동시키세요.
익명사용자 님이 2015년 11월 20일 답변
월희님이 2015년 11월 20일 채택됨
...