我正在嘗試使用https://github.com/chrisbanes/Android-PullToRefresh/。我跟着例子,但得到的錯誤 java.lang.NoSuchFieldError的:com.handmark.pulltorefresh.library.R $ id.pull_to_refresh_sub_text
這是我的網格:
<com.handmark.pulltorefresh.library.PullToRefreshGridView
xmlns:ptr="http://schemas.android.com/apk/res/com.abc.myproject"
android:id="@+id/gv_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:listSelector="#00000000"
android:padding="4dp"
android:horizontalSpacing="4dp"
android:verticalSpacing="4dp"
android:gravity="center"
android:numColumns="3"
android:columnWidth="128px"
android:stretchMode="columnWidth"
ptr:ptrMode="pullDownFromTop"
ptr:ptrDrawable="@drawable/android" />
當我跑我有以上例外。我將PullToRefresh添加爲工作空間中的另一個項目,並將其作爲我的項目庫。我還添加了Jar文件。我認爲錯誤是因爲行 xmlns:ptr =「http://schemas.android.com/apk/res/com.abc.myproject」?
我跟蹤了代碼,導致異常的行在LoadingLayout.java中: mSubHeaderText =(TextView)header.findViewById(R.id.pull_to_refresh_sub_text);
我做錯了什麼?
謝謝!
我也有同樣的問題,你能解決你的問題嗎? –