markmjw / pulltorefresh Goto Github PK
View Code? Open in Web Editor NEW根据Maxwin的XListView改造而来,完善下拉刷新上拉加载更多的功能并实现自动刷新以及自动加载等功能, 并增加对ScrollView的支持。 原XListView参考链接:https://github.com/Maxwin-z/XListView-Android
License: Apache License 2.0
根据Maxwin的XListView改造而来,完善下拉刷新上拉加载更多的功能并实现自动刷新以及自动加载等功能, 并增加对ScrollView的支持。 原XListView参考链接:https://github.com/Maxwin-z/XListView-Android
License: Apache License 2.0
嵌套ViewFlow后,不能刷新了
for viewpager
我嘗試在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時獲取對應內容,運行后發現沒有觸發成功,請教下是不是思路哪裡有錯,謝謝
RT
在XScrollView中使用ListView 导致 ListView的(重用)缓存优化机制失效
计算listview高度时会直接生成所有的item
如题:ScrollView下包含一个Linearlayout和一个ListView,需要实现这个ListView带上上拉刷新功能
当数据不足填充到整个屏幕时,底部会有一条黑线,手指缓缓上拉,可以看见这条黑线正在下滑,等到下滑到屏幕底部时,又会跳回数据底部;当没有数据时,会出现两条,上面一条,下面一条,手指下拉,可以看见两条线跟随下滑,放开手指后两条线弹回原处……
我怀疑是header和footer的问题,但是技术不好,没找到根源,麻烦了!
XLixtView在FragmentTabHost的Fragment中无法上下滑动
刷新不满一屏幕有残影 跪求啊
当数据不足一屏幕时,FootView 加载更多会显示在尾部,这个我可以处理,还有当刷新时FootView 也会显示加载........不知如何处理大神指点
Dear Mark,
I want to use your algorithm with listview to gridview. Please help me
Thank you so much.
错误: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>
设置了click事件以后的view不能下拉
低于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);
}
My account was compromised, as a result many spam issues got created across multiple repos. I am deleting all such issues. Please check my tweet: https://x.com/arghyac35/status/1729721954909684064?s=20
目前我给你的XScrollView添加了如下 event 拦截解决了问题
@OverRide
public boolean onInterceptTouchEvent(MotionEvent ev) {
return ev.getAction() == MotionEvent.ACTION_MOVE || super.onInterceptTouchEvent(ev);
}
首先开启上拉刷新和自动加载功能,当到最后一页的时候,关闭上拉刷新(主要是为了隐藏加载更多按钮),这个时候滚动条不能滑到最底部,而且滑动到底部的时候会有震动现象。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.