[問題] 自定義的 widget
自定義了一個 ListView 的 Widget
錯誤是發生在 setContentView 時
而我的 layout 如下
--------------------------------------------------------------
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<demo.my.widget.myListView
android:id="@+id/android:list"
android1:layout_width="match_parent"
android1:layout_height="wrap_content"
/>
</LinearLayout>
--------------------------------------------------------------
可是會出現這樣的錯誤訊息
demo.my.widget.myListView failed to instantiate.
堆疊的最後一個是這個
java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to
android.widget.RelativeLayout
試過 Clean...
沒輒
我自己定義的 ListView Widget 是放在 demo.my.widget 下
就如同錯誤訊息裡的那個 package name
而程式是在 demo.my.activity 這個 package 裡
一直無解,懇請提供方向,感謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.251.154.220
→
08/21 19:13, , 1F
08/21 19:13, 1F
→
08/21 21:40, , 2F
08/21 21:40, 2F
→
08/21 21:40, , 3F
08/21 21:40, 3F
→
08/21 21:44, , 4F
08/21 21:44, 4F