ListView가 포함 된 내 조각 중 하나에 SwipeRefreshLayout
을 사용하고 있습니다.Android Studio에서 새로 고침 스 와이프 핸들러 설정
swipeLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipe_refresh);
swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
swipeLayout.setRefreshing(true);
view.refreshDrawableState();
swipeLayout.setRefreshing(false);
}
});
내가 스 와이프 때마다 내 ListView를 새로 고치기 위해이 작업을 수행하지만 아무 것도 업데이트되지 않습니다.
내 레이아웃은 다음과 같이 구현됩니다
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/swipe_refresh"
android:background="@drawable/bg"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/match_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="255"/>
</android.support.v4.widget.SwipeRefreshLayout>
가 왜 작동하지 않습니다 ?
'refreshDrawableState()'는 생각하지 않습니다. 거기에'Adapter'의 데이터 셋을 업데이트해야합니다. –