我正在尝试我的应用程序的一种奇怪行为:所有透明背景都被随机图像替换。这是一个例子(对不起大尺寸):
这是一个在中心有一个 RelativeLayout 的活动(具有透明背景),其中包含一个 listView(每个单元格都有透明背景)。您可以看到这个巨大的注销图像替换了所有透明背景。此图像用于完全不同的布局,根本不会出现在活动布局的 xml 文件中。这个问题只存在于(据我所知)三星 Galaxy Note(我全心全意地讨厌它),并且它在我使用的所有其他设备以及模拟器中都可以正常运行。我已经清理了项目,重新安装了应用程序以及我所知道的所有其他故障排除初步做法。
有人知道发生这种情况的原因吗?
这是xml文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/io_guido_background" >
<!-- header -->
<RelativeLayout
android:id="@+id/headerlayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/pezzo_bar"
android:gravity="top" >
<ImageView
android:id="@+id/header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:scaleType="fitStart"
android:src="@drawable/logo_bar" />
<TextView
android:id="@+id/titolo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="30dp"
android:layout_marginTop="10dp"
android:gravity="left|top"
android:text="Archivio"
android:textColor="@color/white"
android:textSize="16dp"
android:textStyle="bold" />
</RelativeLayout>
<!-- body -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/headerlayout" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="480dp"
android:layout_centerInParent="true"
android:orientation="vertical" >
<!-- box date -->
<RelativeLayout
android:id="@+id/sceltadate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@drawable/io_guido_rect_2" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:background="@drawable/io_guido_periodo"
android:scaleType="fitStart" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Da: "
android:textColor="@color/black" />
<Button
android:id="@+id/dabtn"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:background="@drawable/textedit_state"
android:onClick="setData" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:text="A: "
android:textColor="@color/black" />
<Button
android:id="@+id/abtn"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:background="@drawable/textedit_state"
android:onClick="setData" />
</LinearLayout>
</RelativeLayout>
<!-- -->
<!-- body lista -->
<RelativeLayout
android:id="@+id/body"
android:layout_width="fill_parent"
android:layout_height="338dp"
android:layout_above="@+id/legenda"
android:layout_below="@+id/sceltadate"
android:layout_margin="10dp" >
<RelativeLayout
android:id="@+id/subbody"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/backgroung"
android:background="#f3f3f3" >
</RelativeLayout>
<ImageView
android:id="@+id/backgroung"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@drawable/io_guido_rect_3_new" />
<!-- logo
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="30dp"
android:layout_marginRight="10dp"
android:scaleType="fitStart"
android:src="@drawable/logo_trasparente" />
fine logo -->
<!-- lista -->
<LinearLayout
android:id="@+id/layoutlista"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ListView
android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:background="@color/transparent"
android:cacheColorHint="@color/transparent" >
</ListView>
</LinearLayout>
<!-- sfondoTop -->
</RelativeLayout>
<!-- fine bodyLista -->
<!-- body legenda -->
<LinearLayout
android:id="@+id/legenda"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="15dp"
android:gravity="center_horizontal"
android:orientation="horizontal" >
<!-- Prenotata -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:paddingRight="10dp" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ready" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Prenotata"
android:textColor="@color/black" />
</LinearLayout>
<!-- In corsa -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/pronta" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="In corsa"
android:textColor="@color/black" />
</LinearLayout>
<!-- terminata -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="10dp" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ok" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Terminata"
android:textColor="@color/black" />
</LinearLayout>
<!-- Annullata -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="10dp" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/x" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Annullata"
android:textColor="@color/black" />
</LinearLayout>
</LinearLayout>
<!-- fine body legenda -->
</RelativeLayout>
</RelativeLayout>
<!-- fine body -->
</RelativeLayout>