|
轉(zhuǎn)載地址:http://my.oschina.net/cuitongliang/blog/170708 (一)&&http://my.oschina.net/cuitongliang/blog/170737 (二) PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED 一、介紹Pull To Refresh Views for Android This project aims to provide a reusable Pull to Refresh widget for Android. It was originally based on Johan Nilsson's library (mainly for graphics, strings and animations), but these have been replaced since.
Repository at https://github.com/chrisbanes/Android-PullToRefresh. 附源碼截圖: ListView ExpandableListView
GridView WebView
ScrollView Horizontal ScrollView
ViewPager ListView Fragment
WebView Advanced ListView in ViewPager
二、DEMO導(dǎo)入
很多人看到有好源碼,但是在使用時碰到了問題。在此簡單介紹一下,希望能夠?qū)δ切┎粫耐瑐冇兴鶐椭?/p> 首先下載源碼,源碼地址:https://github.com/chrisbanes/Android-PullToRefresh。 1. 導(dǎo)入library:導(dǎo)入很簡單,如圖,點擊finish即可。
導(dǎo)入之后沒有問題。OK! 2. 同樣導(dǎo)入extras中的PullToRefreshListFragment和PullToRefreshViewPager工程。切記:分別導(dǎo)入。
導(dǎo)入之后,你會發(fā)現(xiàn)工程報錯了,很簡單,沒有關(guān)聯(lián)libraray。右鍵工程--選擇Properties,打開之后會發(fā)現(xiàn)有個紅色的X,這就是報錯的原因。改了就可以。
選中紅色的報錯的library,點擊Remove,再點擊Add,將Libarary添加上即可!如圖: 同理將PullToRefreshViewPager工程的library也修改好。 3. 導(dǎo)入Sample工程,同時修改library。如圖: 至此,工程全部導(dǎo)入,錯誤全部解決。
運行一下,看是否能夠正常運行到手機上。接下來就可以慢慢研究著精品源碼吧! 感謝原作者詳細的講解,解決了我的問題! 三、DEMO導(dǎo)入出現(xiàn)問題及解決一、運行報錯:Unable to execute dex: Multiple dex files define Lcom/my/cop/miles/R$anim
|
|
|
來自: aaawoyucheng > 《Android》