<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/off_background">
<ImageView
android:id="@+id/bottom_layer"
android:src="@drawable/handle"/>
<ImageView
android:id="@+id/upper_layer"
android:src="@drawable/switch_v"/>
</FrameLayout>
每当执行此代码时:
inflater.inflate(R.layout.settings_switch, this);
我收到此错误:
10-29 13:27:00.090: E/AndroidRuntime(22364): Caused by: java.lang.RuntimeException: Binary XML file line #7: You must supply a layout_width attribute.
怎么会这样?
我有
android:layout_width="match_parent"
android:layout_height="match_parent"