我正在进行一些Android性能测试,并注意到当我打开" Show OverDraw"我的应用程序在所有活动中显示出很好的蓝色效果。来自开发者选项。然后我注意到在一个运行KitKat的Nexus 5和另一个运行KitKat的HTC ONE上,所有东西都是RED的海洋。为什么只有kitKat设备透支?
这是有问题的布局的xml(请原谅硬编码的尺寸和颜色,我已经与团队讨论了这种做法)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/top_area"
android:layout_width="match_parent"
android:layout_height="47dp"
android:layout_gravity="top"
android:background="#ff000000"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/light_layout"
android:layout_width="100dp"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:clickable="true"
android:contentDescription="Turn on light"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/textView"
android:layout_width="35dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:minHeight="30dp"
android:minWidth="100dp"
android:text="Light"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#fff" />
</LinearLayout>
<LinearLayout
android:id="@+id/cancel_layout"
android:layout_width="100dp"
android:layout_height="fill_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:clickable="true"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="1">
<TextView
android:id="@+id/textView2"
android:layout_width="35dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_weight="0.29"
android:clickable="false"
android:minHeight="30dp"
android:minWidth="100dp"
android:text="Cancel"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#fff" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="8">
<FrameLayout
android:id="@+id/csZbarScannerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<View
android:id="@+id/rect_layout"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_centerInParent="true"
android:orientation="horizontal"
android:background="@drawable/scanner_target_rect">
</View>
</RelativeLayout>
<LinearLayout
android:id="@+id/footer_layout"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_gravity="bottom|center_horizontal">
<include
android:id="@+id/browse_tab"
layout="@layout/footer_button"
android:layout_width="83dp"
android:layout_height="fill_parent"
android:layout_weight="1"></include>
<include
android:id="@+id/myitem_tab"
layout="@layout/footer_button"
android:layout_width="83dp"
android:layout_height="fill_parent"
android:layout_weight="1"></include>
<include
android:id="@+id/checklist_tab"
layout="@layout/footer_button"
android:layout_width="83dp"
android:layout_height="fill_parent"
android:layout_weight="1"></include>
<include
android:id="@+id/scan_tab"
layout="@layout/footer_button"
android:layout_width="83dp"
android:layout_height="fill_parent"
android:layout_weight="1"></include>
</LinearLayout>
</LinearLayout>