1
の外側をタップしても呼ばれ、私はこのレイアウトのベースがあります。このフラグメントの作成時アンドロイド:setOnRefreshListenerは、私は私のListView
<RelativeLayout
android:id="@+id/list_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_list_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/list_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/background" />
</android.support.v4.widget.SwipeRefreshLayout>
</RelativeLayout>
は、私は特定のリストを追加します。
<ListView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:divider="@color/list_divider"
android:dividerHeight="1px" />
ので、私は赤でエリア(リストビューの外側)をタップしたときに、リスナーが呼び出されます。
mSwipeContainer.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
...
}
});
なぜ、このリスナーが呼び出されたのですか?その動作を回避できますか?
変更 'アンドロイド:アンドロイド'へlayout_height = "wrap_content" ':layout_height = "match_parent"'又はSwipeRefreshLayout赤色領域がそれの一部 –
ためwrap_content'はSwipeRefreshは、matchcontentに設定されている'使用:layout_height = "wrap_content" ' – user6547359
'アンドロイドになるように高さ –