Code Monkey home page Code Monkey logo

pulltorefresh's Issues

adapter點擊事件無效

我嘗試在initView尾添加

mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@OverRide
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
TextView textView=(TextView)view.findViewById(R.id.list_item_text);
Toast.makeText(view.getContext(),textView.getText(), Toast.LENGTH_SHORT);
}
});

代碼:

private void initView() {
mHandler = new Handler();
mListView = (XListView) findViewById(R.id.list_view);
mListView.setPullRefreshEnable(true);
mListView.setPullLoadEnable(true);
mListView.setAutoLoadEnable(true);
mListView.setXListViewListener(this);
mListView.setRefreshTime(getTime());
mAdapter = new ArrayAdapter(this, R.layout.vw_list_item, items);
mListView.setAdapter(mAdapter);
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@OverRide
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
TextView textView=(TextView)view.findViewById(R.id.list_item_text);
Toast.makeText(view.getContext(), textView.getText(), Toast.LENGTH_SHORT);
}
});
}

希望實現點擊對應item時獲取對應內容,運行后發現沒有觸發成功,請教下是不是思路哪裡有錯,謝謝

下拉刷新界面会卡住

qq20140217223143
就是下拉刷新的时候,力度要小,不要触发下拉刷新的基础下拉几次就会出现以上情况.,安卓版本4.0以上都会出现。4.0以下没有测过。

数据不足填充屏幕或无数据时,会出现两条黑线

当数据不足填充到整个屏幕时,底部会有一条黑线,手指缓缓上拉,可以看见这条黑线正在下滑,等到下滑到屏幕底部时,又会跳回数据底部;当没有数据时,会出现两条,上面一条,下面一条,手指下拉,可以看见两条线跟随下滑,放开手指后两条线弹回原处……
我怀疑是header和footer的问题,但是技术不好,没找到根源,麻烦了!

FootView不完美

当数据不足一屏幕时,FootView 加载更多会显示在尾部,这个我可以处理,还有当刷新时FootView 也会显示加载........不知如何处理大神指点

PullRefreshto GridView

Dear Mark,
I want to use your algorithm with listview to gridview. Please help me

Thank you so much.

XScrollView can host only one direct child

错误:ScrollView can host only one direct child

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
    <com.Widget.pulltorefresh.XScrollView
                android:id="@+id/xScrollView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fillViewport="true"
                android:scrollbars="none" >

        <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/x40"
                android:layout_marginRight="@dimen/x40"
                android:orientation="vertical">
            <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:drawablePadding="@dimen/x20"
                    android:gravity="center_vertical"
                    android:layout_marginTop="@dimen/y50"
                    android:text=" 监控"
                    android:textSize="@dimen/x36"
                    android:textStyle="bold"
                    android:textColor="@color/titlebar_Text_color"/>
        </LinearLayout>
    </com.Widget.pulltorefresh.XScrollView>
</RelativeLayout>

低版本兼容性问题

低于Jellybean版本报如下错误:
01-20 08:53:00.141: E/AndroidRuntime(24005): java.lang.NoSuchMethodError: android.view.ViewTreeObserver.removeOnGlobalLayoutListener
01-20 08:53:00.141: E/AndroidRuntime(24005): at com.markmao.pulltorefresh.widget.XListView$1.onGlobalLayout(XListView.java:107)

已修正:
将107行代码替换如下:
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
observer.removeGlobalOnLayoutListener(this);
} else {
observer.removeOnGlobalLayoutListener(this);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.