相同的 XML 在 Android 4.3 和 4.4 中看起来不同。问题是Kitkat(4.4)没有拿起这条线:"android:background="@drawable/darkgray"
(darkgray.jpg是一个img)
为什么 Kitkat 的行为有所不同?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.mavdev.focusoutfacebook"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/darkgray"
android:orientation="vertical" >
<TextView
android:id="@+id/tv_secs2"
android:layout_width="100dp"
android:layout_height="wrap_content"
/>
</RelativeLayout>
区别如下: