0

ViewPager 용 조각 안에 RecyclerView가 있습니다. RecyclerView의 각 항목은 LinearLayout입니다. 내 문제는 RecyclerView를 터치 할 때 페이지를 스 와이프 할 수 없다는 것입니다. RelativeLayout으로 시도해 보았습니다. 그래서 문제가 LinearLayout에 있습니다. ViewPager의 LinearLayout이 스 와이프를 비활성화합니다.

내 조각 레이아웃 :

<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" android:layout_height="match_parent" 
    /> 

행 레이아웃 :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" 
    android:weightSum="1"> 
    <TextView 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="0.05" 
     android:textAlignment="center" 
     android:id="@+id/game_all_text_number" 
     android:singleLine="true" 
     android:ellipsize="marquee" 
     android:marqueeRepeatLimit="marquee_forever" 
     /> 
    <TextView 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="0.225" 
     android:textAlignment="center" 
     android:id="@+id/game_all_text_player1" 
     android:singleLine="true" 
     android:ellipsize="marquee" 
     android:marqueeRepeatLimit="marquee_forever" 
     /> 
    <TextView 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="0.225" 
     android:textAlignment="center" 
     android:id="@+id/game_all_text_player2" 
     android:singleLine="true" 
     android:ellipsize="marquee" 
     android:marqueeRepeatLimit="marquee_forever" 
     /> 
    <TextView 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="0.225" 
     android:textAlignment="center" 
     android:id="@+id/game_all_text_player3" 
     android:singleLine="true" 
     android:ellipsize="marquee" 
     android:marqueeRepeatLimit="marquee_forever" 
     /> 
    <TextView 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="0.225" 
     android:textAlignment="center" 
     android:id="@+id/game_all_text_player4" 
     android:singleLine="true" 
     android:ellipsize="marquee" 
     android:marqueeRepeatLimit="marquee_forever" 
     /> 
    <TextView 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="0.05" 
     android:textAlignment="center" 
     android:id="@+id/game_all_text_diff" 
     android:singleLine="true" 
     android:ellipsize="marquee" 
     android:marqueeRepeatLimit="marquee_forever" 
     /> 
</LinearLayout> 

내가 RelativeLayout의에 행의 부모를 변경하는 경우, 내가 슬쩍 수 있으며이 잘 작동하지만, LinearLayout 인 경우에는 그렇지 않습니다.

RecyclerView를 전혀 클릭 할 필요가 없습니다. RecyclerView에서 수행 된 모든 스 와이프 또는 터치 이벤트를 비활성화하고 조각으로 보낼 수있는 방법이 있습니까?

답변

1

시도 그것은 작동하지 않았다

+0

있는 LinearLayout

android:clickable="false" android:focusable="false" android:focusableInTouchMode="false" 
RecyclerView에

나 항목을 설정. RecyclerView 만 설정해 보았습니다. 그런 다음 LinearLayout 만 사용하고 두 가지를 모두 수행해도 아무 것도 작동하지 않았습니다. 여전히 페이지를 스 와이프 할 수 없습니다. –

관련 문제