【问题标题】:SwipeRefreshLayout com.android.layoutlib.bridge.MockView cannot be cast to android.view.ViewGroupSwipeRefreshLayout com.android.layoutlib.bridge.MockView 无法转换为 android.view.ViewGroup
【发布时间】:2014-10-01 18:29:45
【问题描述】:

我收到了这个错误:

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,但是还是没有解决问题。

【问题讨论】:

  • 请发布 logcat 输出。
  • @GauravArora 它发生在eclipse中,而不是运行时。
  • 非常适合我,我正在使用 Luna Release (4.4.0)。可能是你升级的时候了。
  • @GauravArora 你能描述一下“升级”是什么意思吗?
  • 你使用的是什么版本的 Eclipse?

标签: android xml swiperefreshlayout


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多