0

내 ListView에 대한 사용자 지정 ListItem을 구현했습니다. 을 ListItem은 다음과 같습니다세로 스크롤 텍스트 ListItem?

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/rlOfferRoot" 
    android:layout_width="fill_parent" 
    android:layout_height="60dp" 
    android:padding="5dp" 
    android:background="@color/white"> 


     <RelativeLayout 
     android:id="@+id/rlOfferDetails" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:background="#000000"> 

     <LinearLayout 
      android:id="@+id/llOfferRoot" 
      android:layout_width="fill_parent" 
      android:layout_height="200dp" 
      android:orientation="vertical" 
      android:background="@color/orange"> 
      <ImageView 
       android:id="@+id/imgOfferImage" 
       android:layout_width="fill_parent" 
       android:layout_height="match_parent"/> 
     </LinearLayout> 
     <LinearLayout 
      android:id="@+id/menuDrawerLayer" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:gravity="bottom" 
      android:layout_gravity="bottom"> 

     <SlidingDrawer 
      android:id="@+id/sdOfferDetails" 
      android:layout_width="fill_parent" 
      android:layout_height="200dp" 
      android:layout_alignBottom="@id/imgOfferImage" 
      android:content="@+id/drawerButtons" 
      android:handle="@+id/slideHandleButton" 
      android:topOffset="-50dp"> 

      <Button 
       android:id="@+id/slideHandleButton" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:background="@drawable/arrowup"/> 

      <RelativeLayout 
       android:id="@+id/drawerButtons" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:background="#80000000"> 
       <ScrollView 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:scrollbars="vertical" 
       android:padding="10dp" 
       android:focusable="true"> 
       <TextView 
        android:id="@+id/txtOfferDetails" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:textColor="@color/white" 
        android:text="This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text 
          This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text 
          This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text 
          This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text end 
          This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text end 
          This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text end 
          This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text end 
          This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text end 
          This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text end"/> 
       </ScrollView> 
     </RelativeLayout> 
     </SlidingDrawer> 
    </LinearLayout> 

    </RelativeLayout> 
    </RelativeLayout> 

이 멋지다 나는 내 SlidingDrawer를 열고 텍스트 뷰에 포함 된 텍스트를 스크롤 할 때를 제외하고 예상대로 수행한다.

TextView에 대한 스크롤 막대가 잠시 나타나면 TextView가 포커스를 얻는 것처럼 보이지만 ListView는 포커스를 잡고 전체 목록이 스크롤하기 시작합니다.

정렬을 위해 사용자 지정 ListView를 구현해야합니까? 아니면 빠른 수정입니까? 위와 동일하게 시도했지만 작동했던 HorizontalScrollScrollView를 사용했지만 ListView가 수평 스크롤 이벤트에 아무런 영향을주지 않기 때문에 가능합니다.

는 어떤 도움은있는 ScrollView에 터치 리스너에

답변

1

설정 감사

OnTouchListener childScroll = new View.OnTouchListener() { 

      @Override 
      public boolean onTouch(View v, MotionEvent event) { 
       v.getParent().requestDisallowInterceptTouchEvent(true); 
        return false ; 
      } 
    }; 
관련 문제