【发布时间】:2019-04-06 09:00:02
【问题描述】:
我想知道为什么 View 不适用于通知布局。
InflateException: Binary XML file line #8: Error inflating class ImageView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imagenotileft"
android:layout_width="@dimen/_10sdp"
android:layout_height="@dimen/_10sdp"
android:layout_margin="@dimen/_5sdp"
android:layout_marginBottom="@dimen/_5sdp"
android:gravity="center"
android:src="@drawable/app_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="Bytepaper"
android:textColor="@color/colorPrimary" />
<View
android:layout_width="@dimen/_1sdp"
android:layout_height="match_parent"
android:layout_margin="@dimen/_5sdp"
android:background="@color/greyTextColor" />
<TextView
android:id="@+id/textNotifMail"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="Bytepaper"
android:textColor="@color/greyTextColor" />
<View
android:layout_width="@dimen/_1sdp"
android:layout_height="match_parent"
android:layout_margin="@dimen/_5sdp"
android:background="@color/greyTextColor" />
<TextView
android:id="@+id/textNotifTime"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="Bytepaper"
android:textColor="@color/greyTextColor" />
</LinearLayout>
请看我使用了<View/>标签。
【问题讨论】:
-
我觉得 grayTextColor 有问题
-
请edit您的问题提供完整的stack trace。
标签: java android android-layout android-view