我在 Android 4.2 及更高版本上有一个奇怪的错误。我有一个自定义视图(它是经典的 RelativeLayout,而不是来自外部库的小部件),它在严格低于 4.2 的 Android 版本上看起来像这样(正常外观):
但在 Android 4.2 及更高版本上看起来像这样(白色背景 = 错误):
有谁知道可能是什么原因?我记得我从我的项目中删除了一些 holo.theme 文件,因为我认为主题无用,我不明白为什么会这样,只是为了提供完整的信息。
有关信息,我直接在 xml 中设置背景,如下所示:
<ImageView
android:id="@+id/woodOfTopBarImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:layout_alignTop="@+id/topBarButtonsRelativeLayout"
android:layout_alignBottom="@+id/topBarButtonsRelativeLayout"
android:src="@drawable/topbaripad3_2x"
/>
谢谢 !!