我試圖讓RelativeLayout
啓動並運行,因此我可以將它用於自定義列表 ,但是當我嘗試將項目間的空間相互比較時,它會將其擰緊並說:無法在xml中解析ID
無法解析資源@ ID/ITEMNAME
無法解析資源@ ID/textPriceFrom
這是奇怪,因爲textPriceFrom
地方本身正確,但價格卻沒有。
這裏是代碼:
<RelativeLayout
android:id="@+id/mainlayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/itemName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="3dip"
android:text="A good day"
android:textSize="23dip"
android:textStyle="bold" />
<TextView
android:id="@+id/textPriceFrom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/itemName"
android:layout_margin="3dip"
android:text="@string/frapris"
android:textSize="15dip"
android:textStyle="normal" />
<TextView
android:id="@+id/textPrice"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="3dip"
android:layout_toLeftOf="@id/textPriceFrom"
android:text="145,95"
android:textSize="10dip"
android:textStyle="normal" />
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_margin="3dip"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
哇 - 我原以爲只會讓左/右視圖不可見,不會導致錯誤 – barry
我也是這樣:但是那是它,當我改變它時,它沒有問題的工作:-) –