2012-12-20 10 views
2

ListView은 화면이 짧고 전체 화면을 채우지 못하는 경우에 대비하여 onScroll 이벤트를 수신하지 않습니다. 이상한 것은 fill_parent을 높이로 설정했기 때문입니다. 내 레이아웃 :ListView가 스크롤 할 수 없음

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@drawable/bg_login_screen3" 
android:orientation="vertical" > 



<CheckBox 
    android:id="@+id/overview_allcars_checkbox" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:gravity="center" 
    android:text="@string/all_cars" 
    android:textSize="14sp" /> 

<LinearLayout 
    android:id="@+id/list_root" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 

    <ListView 
     android:id="@+id/android:list" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:cacheColorHint="#00000000" 
     android:fadingEdge="horizontal" 
     android:scrollingCache="true" /> 
</LinearLayout> 
</LinearLayout> 
+0

아마도 match_parent 대신에 fill_parent가 최고 linearLayout의 높이가 될 것입니다 .. – Daler

+0

fill_parent와 match_parent는 동일하다고 생각합니다. 그들은 똑같이 행동합니다. – slezadav

답변

0

당신은 도움이 답을 찾을 수 있습니다 : -

Making TextView scrollable on Android

이 나에게 도움이 그게 문제 :

<ScrollView 
android:id="@+id/SCROLLER_ID" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:scrollbars="vertical" 
android:fillViewport="true"> 

    <TextView 
    android:id="@+id/TEXT_STATUS_ID" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_weight="1.0"/> 

</ScrollView> 

은 주로 당신은있는 ScrollView에 텍스트 뷰를 포장.

+0

ListView가있는 TextView가없고 ListView를 ScrollView 내부에 배치하는 것은 좋지 않습니다. 또한 ListView에서 onScrollListener를 트리거하는 데 도움이되지 않습니다. – slezadav

+0

답변은 질문과 관련이 없습니다. –

관련 문제