2015-09-04 124 views
1

我必須實現android刷卡刷新listview。我從here得到了示例代碼。但在這段代碼中,向下滑動即可刷新列表視圖。我希望它刷卡刷新listview。如果有人知道答案,請解釋或建議我從哪裏我可以從開始理解鏈接。謝謝。Android Swipe Up刷新ListView

回答

3

請使用

Link圖書館通過設置方向滾動底部/向上。

您可以使用其他SO環節太

SwipeRefreshLayout - Pull From Bottom

+0

[請避免鏈路只有答案(http://meta.stackexchange.com/questions/8231/are-answers-that-just-contain -links-elsewhere-really-good-answers/8259#8259) – 2Dee

+0

下次肯定會小心:) – theLazyFinder

0

您可以使用SwipeRefreshLayout,您需要刷新的佈局應此佈局內給予。

<android.support.v4.widget.SwipeRefreshLayout 
    android:id="@+id/sw_refresh" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <!--layout which should be refreshed should come here--> 

     <ListView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"></ListView> 

     </android.support.v4.widget.SwipeRefreshLayout> 

    </RelativeLayout> 

您可以在Android swipe to refresh listview layout看到完整的實現