如何监听UITableView的滚动

2024-12-12 04:39:32
推荐回答(1个)
回答1:

这是监听不了的,listview和scrollview不能同时使用要使用必须设置listview不能滚动publicclassMyListViewextendsListView{publicMyListView(Contextcontext,AttributeSetattrs,intdefStyle){super(context,attrs,defStyle);//TODOAuto-generatedconstructorstub}publicMyListView(Contextcontext,AttributeSetattrs){super(context,attrs);//TODOAuto-generatedconstructorstub}publicMyListView(Contextcontext){super(context);//TODOAuto-generatedconstructorstub}@OverridepublicvoidonMeasure(intwidthMeasureSpec,intheightMeasureSpec){intexpandSpec=MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE>>2,MeasureSpec.AT_MOST);super.onMeasure(widthMeasureSpec,expandSpec);}