问题
Using the new SwipeRefreshLayout from Support Revision 21 (or latest today, from sdk manager) I get it to work but I need to move down the view using
import android.support.v4.widget.SwipeRefreshLayout;
....
mSwipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipe);
mSwipeLayout.setProgressViewOffset(false, 100, 150)
The method setProgressViewOffset(boolean, int, int) is undefined for the type SwipeRefreshLayout.
How to fix this?
回答1:
Clean your project and rebuild. You may be compiling the old SwipeRefreshLayout
into your APK.
If you are using gradle, make sure you are referencing version 21.0.0 of the support-v4 library.
Or if you are using the JAR, make sure you don't have the old JAR version being included.
回答2:
Talklittle was right.
This answer fixed my problem.
I had facebook SDK which had an older support library than the project I was working on.
t seems like the different projects are using 2 separate support libraries and there for the checksum is different.
You must repeat this for both the Facebook SDK project and the app you are building.
what I do when I get this error is:
1. Right click the project.
2. Android Tools -> Add support library
3. Accept the downloading of the library.
this insures 2 things:
A. You get the newest version of the support library from the Google sources.
B. You have the EXACT same library in all your projects.
来源:https://stackoverflow.com/questions/26713832/setprogressviewoffsetboolean-int-int-is-undefined-for-the-type-swiperefreshl