有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Android PullToRefresh ptrOverScroll=“false”不工作

我添加了compile'com。navercorp。pulltorefresh:库:3.2。3@aar“为了我的身材。格拉德尔

<com.handmark.pulltorefresh.library.PullToRefreshListView
    xmlns:ptr="http://schemas.安卓.com/apk/res-auto"
    安卓:id="@+id/pull_refresh_list"
    安卓:layout_width="fill_parent"
    安卓:layout_height="fill_parent"
    安卓:fadingEdge="none"
    安卓:fastScrollEnabled="false"
    安卓:footerDividersEnabled="false"
    安卓:headerDividersEnabled="false"
    安卓:smoothScrollbar="true"
    安卓:overScrollMode="never"
    ptr:ptrOverScroll="false"/>

我这样创建了我的xml

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_example);

    mPullRefreshListView = (PullToRefreshListView) findViewById(R.id.pull_refresh_list);
    mPullRefreshListView
            .setOnRefreshListener(new OnRefreshListener<ListView>() {
                @Override
                public void onRefresh(
                        PullToRefreshBase<ListView> refreshView) {
                    new ProcessTask().execute();
                }
            });

    items = new String[31];
    for (int index = 0; index <= 30; index++) {
        items[index] = "list " + index;
    }
    mPullRefreshListView.setAdapter(new ArrayAdapter<String>(this,
            安卓.R.layout.simple_list_item_1, items));
}

public class ProcessTask extends AsyncTask<String, Integer, Long> {

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
    }

    @Override
    protected Long doInBackground(String... params) {
        try {
            Thread.sleep(2000);
            Toast.makeText(getApplicationContext(), "dddd",
                    Toast.LENGTH_SHORT).show();
        } catch (Exception e) {
            return 0l;
        }
        return 1l;
    }

    @Override
    protected void onPostExecute(Long result) {
        super.onPostExecute(result);

        mPullRefreshListView.onRefreshComplete();
    }
}

pullToRefresh工作正常。但过卷永远不会被移除

我浪费了6个小时试图解决这个问题

有什么问题吗


共 (0) 个答案