I have been trying to run this code but getting this error since last 1 week.
请帮忙! 我已经声明了layout:width。 在滑动抽屉中尝试layout.width并替换dp wit dip但仍然遇到相同的错误。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<SlidingDrawer
android:id="@+id/drawer"
android:width="320dp"
android:height="440dp"
android:orientation="vertical"
android:content="@+id/content"
android:handle="@+id/handle">
<ImageView
android:id="@+id/handle"
android:layout_width="48dp"
android:layout_height="48dp"
android:src="@drawable/ic_launcher"/>
<AnalogClock
android:id="@+id/content"
android:background="#D0A0A0"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</SlidingDrawer>
</RelativeLayout>
答案 0 :(得分:1)
我认为布局标签是强制性标签。您尚未向SlidingDrawer
android:layout_width="fill_parent"
android:layout_height="fill_parent"