2014-10-01 68 views
1

我收到此错误:SwipeRefreshLayout com.android.layoutlib.bridge.MockView不能转换到android.view.ViewGroup

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> 

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

+0

请发布logcat输出。 – 2014-10-01 18:44:52

+0

@GauravArora它发生在eclipse中,而不是在运行时。 – Malek 2014-10-01 19:00:52

+0

适合我的作品,我使用Luna Release(4.4.0)。可能是您升级的时候了。 – 2014-10-01 19:24:38

回答

0

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

相关问题