setProgressViewOffset(boolean, int, int) is undefined for the type SwipeRefreshLayout

感情迁移 提交于 2019-12-14 03:13:35

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!