读书人

android BaseAdapter 适配器中的getvi

发布时间: 2012-06-30 17:20:12 作者: rapoo

android BaseAdapter 适配器中的getview()方法的调用者是谁?

getView是由framework调用的。如果要framework调用getView(),可以尝试用BaseAdapter.notifyDataSetChanged ()方法试试。在家的破电脑,暂不能尝试。GridView 主要是为了快速开方,很多地方要自定义不是很方便。如果要更多的自主操作,可以用下面的形式。<ScrollView>  <LinearLayout android:orientation="vertical">    <LinearLayou android:orientation="horizontal">    </LinearLayout>  </LinearLayout></ScrollView> ----------getView ,只是在childview从屏幕外移到屏幕中的时候会被调用。当你移到倒数第二个childview的时候,实际上肯定是调用了最后一个childview的getView函数。你可以试试在getVIew中加入System.out.println("getView:"+position);

读书人网 >Android

热点推荐