1
好吧」我有一個RelativeLayout的Android的相對佈局背景崩潰
<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:clickable="true"
android:background="@drawable/my_shape_normal"
android:onClick="startTestTillError">
和my_shape_normal被定義爲
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#FFFFFF00"
android:endColor="#80FFFFFF"
android:angle="120"/>
<padding android:left="7dp"
android:top="7dp"
android:right="7dp"
android:bottom="7dp" />
<corners android:radius="8dp" />
</shape>
在加載將引發異常:android.view.InflateException在RelativeLayout的的路線。如果我刪除「android:background」,一切都很完美。 my_shape_normal有什麼問題?
如果您的應用程序崩潰,最好包含您的LogCat錯誤。 – Sam