2016-10-12 13 views
1

私は水平スクロールイメージビューアを持つ相対レイアウトを持っています。問題は、この相対レイアウトの親ビューもSwipeToRefreshLayoutであるため、ユーザーがスクロールしてわずかにスクロールしてacを開始するということです。コードを参照してください: ハンドルを相対レイアウト上にドラッグ

<android.support.v4.widget.SwipeRefreshLayout 
     android:id="@+id/item_activity_swipe_refresh_layout" 
     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:layout_width="match_parent" 
     android:layout_height="match_parent" 
     tools:context=".item.ItemActivity"> 



     <android.support.design.widget.CoordinatorLayout 
     android:id="@+id/item_activity_coordinatorLayout" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     <android.support.design.widget.AppBarLayout 
      android:id="@+id/item_activity_app_bar" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:fitsSystemWindows="true" 
      app:elevation="0dp" 
      app:theme="@style/ToolbarStyle"> 

      <!-- This is the view I dont want to handle Swipe to refresh/Scroll content up (Scrolling down the screen) --> 
      <RelativeLayout 
       android:id="@+id/scrollable_image_container" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_alignParentTop="true" 
       app:layout_behavior="@string/appbar_scrolling_view_behavior"/> 


       <!-- ....omit other code --> 
     </android.support.design.widget.AppBarLayout> 
     </android.support.design.widget.CoordinatorLayout> 
    </android.support.v4.widget.SwipeRefreshLayout> 

は、私は上記の相対的なレイアウトは基本的にダウン指をドラッグしてスクロールをリフレッシュするために活性化以外の他のすべてのジェスチャーを渡したいです。私は水平スクロールを扱うためにそのビューが必要です(それは既にありますが、ユーザーがわずかな角度を下にスクロールすると画像ビューアーがわずかにスライドしますが、スワイプも開始されます)。 https://developer.android.com/training/gestures/viewgroup.html が、その遠くなるような私の心と私は?

されているはずですそのでも正しいことは誰にもレイアウトをリフレッシュするためにスワイプで水平スクロール画像か何かを処理しなければならなかったかどうかわからない?

してくださいヘルプ:(

+0

を使用することができますか?これは、通常、水平の 'RecyclerView'に基づいているため、このような問題はありません。 – Beloo

+0

私はビューページャーを使用しています。私は今Recyclerviewを実装しようとしましたが、それはまだ同じ問題があります – x10sion

+0

[this](http://stackoverflow.com/questions/23989910/horizo​​ntalscrollview-inside-swiperefreshlayout)と[this](http://stackoverflow.com/questions/34136178/swiperefreshlayout-blocking-horizo​​ntal-scrolled-recyclerview)質問 – Beloo

答えて

2

コメントからの要約RecyclerViewは、水平アイテムのスクロールの問題に最適です。 ViewPagerよりも優れています。これは、アイテムのリサイクルをサポートしているためです。アニメーションのようなものもあります。 SwipeRefreshLayoutは上下移動のタッチに非常に敏感されることを防ぐために、

、あなたはいくつかの非常に特別なイメージのスライダーを持っていますかsuch technique

関連する問題