0

あるレイアウトを別のレイアウトで再利用しようとしています。再利用したいレイアウトは次のとおりです。

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout android:id="@+id/dashboard"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="wrap_content"
    android:layout_height="wrap_content">
    <RelativeLayout android:id="@+id/reltbl"
        android:layout_gravity="left" android:layout_marginTop="20dp"
        android:layout_below="@+id/linertbl1" android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <ImageButton android:id="@+id/imgBtn"
            android:layout_height="100dp" android:gravity="right"
            android:textColor="#ffffff" android:textStyle="bold"
            android:paddingRight="5dp" android:paddingTop="5dp"
            android:layout_marginTop="10dp" android:layout_marginLeft="30dp"
            android:layout_width="100dp" android:background="@drawable/tasksheet" />
        <TextView android:id="@+id/imgmenubadge"
            android:layout_height="wrap_content" android:text="18"
            android:textColor="#ffffff" android:textStyle="bold" android:gravity="center"
            android:layout_marginTop="1dp" android:layout_marginLeft="103dp"
            android:textSize="16sp" android:layout_width="wrap_content"
            android:background="@drawable/menubgbadge" />
        <TextView android:id="@+id/txttasksheet"
            android:layout_width="match_parent" android:layout_height="wrap_content"
            android:text="My Tasksheet" android:layout_below="@+id/imgBtn"
            android:textColor="#808080" android:textSize="12sp"
            android:layout_marginLeft="40dp" android:textStyle="bold"
            android:typeface="normal" />

    </RelativeLayout>

</RelativeLayout>

そして、これが私が再利用しているメインのxmlコードです

 <include android:id="@+id/cell1" layout="@layout/menubutton"/>

しかし、私はそれを見ようとします。有効なレイアウト参照を指定する必要があるという Inflate 例外が発生します。

初めてインクルードを使用していますが、ばかげた間違いや何か不足している場合は教えてください??

4

0 に答える 0