1

我收到了这个错误:

Exception raised during rendering: com.android.layoutlib.bridge.MockView cannot be cast to android.view.ViewGroup
Exception details are logged in Window > Show View > Error Log
The following classes could not be found:
- android.support.v4.widget.SwipeRefreshLayout (Fix Build Path, Edit XML, Create Class)

我的 XML 代码:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ListView android:id="@+id/news_list"
          android:layout_width="match_parent"
          android:layout_height="match_parent" />

</android.support.v4.widget.SwipeRefreshLayout>

我已经重新启动了eclipse,但这并不能解决错误。

4

1 回答 1

0

我通过将 SwipeRefreshLayout 从支持库复制到我的包中解决了这个错误。

于 2014-10-01T22:05:55.180 回答